Files
zitadel/backend/v3/domain/errors.go

30 lines
568 B
Go
Raw Normal View History

2025-04-29 06:03:47 +02:00
package domain
import (
"errors"
"fmt"
2025-04-29 06:03:47 +02:00
)
var ErrNoAdminSpecified = errors.New("at least one admin must be specified")
type wrongIDPTypeError struct {
expected IDPType
got string
}
func NewWrongTypeError(expected IDPType, got string) error {
return &wrongIDPTypeError{
expected: expected,
got: got,
}
}
func (e *wrongIDPTypeError) Error() string {
return fmt.Sprintf("wrong idp type returned, expecgted: %v, got: %v", e.expected, e.got)
}
func (e *wrongIDPTypeError) Is(target error) bool {
_, ok := target.(*wrongIDPTypeError)
return ok
}