Files
zitadel/backend/v3/domain/errors.go
T
911967c865 feat(settings_relational): adding settings table for relational db (#10769)
# Which Problems Are Solved

As part of https://github.com/zitadel/zitadel/issues/9599 to push to
move to a relational db table model, this is the migration of the
settings

# Additional Changes

I had to add 2 non source code files
`backend/v3/storage/database/events_testing/font.otf` and
`backend/v3/storage/database/events_testing/picture.png`, these are used
as part of the reduce tests, hence why they're sourced inside
`backend/v3/storage/database/events_testing/settings_instance_test.go`

- Closes https://github.com/zitadel/zitadel/issues/10207

---------

Co-authored-by: adlerhurst <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Tim Möhlmann <[email protected]>
Co-authored-by: Stefan Benz <[email protected]>
2025-12-02 08:16:21 +01:00

72 lines
1.6 KiB
Go

package domain
import (
"fmt"
)
type wrongIDPTypeError struct {
expected IDPType
got string
}
func NewIDPWrongTypeError(expected IDPType, got fmt.Stringer) error {
return &wrongIDPTypeError{
expected: expected,
got: got.String(),
}
}
func (e *wrongIDPTypeError) Error() string {
return fmt.Sprintf("wrong idp type returned, expected: %v, got: %v", e.expected, e.got)
}
func (e *wrongIDPTypeError) Is(target error) bool {
_, ok := target.(*wrongIDPTypeError)
return ok
}
type MultipleObjectsUpdatedError struct {
Msg string
Expected int64
Actual int64
}
func NewMultipleObjectsUpdatedError(expected, actual int64) error {
return &MultipleObjectsUpdatedError{
Expected: expected,
Actual: actual,
}
}
func (err *MultipleObjectsUpdatedError) Error() string {
return fmt.Sprintf("Message=expecting %d row(s) updated, got %d", err.Expected, err.Actual)
}
type UnexpectedQueryTypeError[T any] struct {
assertedType T
}
func NewUnexpectedQueryTypeError[T any](assertedType T) error {
return &UnexpectedQueryTypeError[T]{
assertedType: assertedType,
}
}
func (u *UnexpectedQueryTypeError[T]) Error() string {
return fmt.Sprintf("Message=unexpected query type '%T'", u.assertedType)
}
type UnexpectedTextQueryOperationError[T any] struct {
assertedType T
}
func NewUnexpectedTextQueryOperationError[T any](assertedType T) error {
return &UnexpectedTextQueryOperationError[T]{
assertedType: assertedType,
}
}
func (u *UnexpectedTextQueryOperationError[T]) Error() string {
return fmt.Sprintf("Message=unexpected text query operation type '%T'", u.assertedType)
}