2025-04-29 06:03:47 +02:00
|
|
|
package domain
|
|
|
|
|
2025-08-08 10:18:22 +01:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
2025-04-29 06:03:47 +02:00
|
|
|
)
|
2025-08-08 10:18:22 +01: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
|
|
|
|
}
|