2020-04-07 16:36:37 +00:00
|
|
|
package sdk
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
2020-04-07 16:36:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
_ AppendEventError = (*appendEventError)(nil)
|
|
|
|
_ errors.Error = (*appendEventError)(nil)
|
|
|
|
)
|
|
|
|
|
|
|
|
type AppendEventError interface {
|
|
|
|
error
|
|
|
|
IsAppendEventError()
|
|
|
|
}
|
|
|
|
|
|
|
|
type appendEventError struct {
|
|
|
|
*errors.CaosError
|
|
|
|
}
|
|
|
|
|
|
|
|
func ThrowAppendEventError(parent error, id, message string) error {
|
|
|
|
return &appendEventError{errors.CreateCaosError(parent, id, message)}
|
|
|
|
}
|
|
|
|
|
|
|
|
func ThrowAggregaterf(parent error, id, format string, a ...interface{}) error {
|
|
|
|
return ThrowAppendEventError(parent, id, fmt.Sprintf(format, a...))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (err *appendEventError) IsAppendEventError() {}
|
|
|
|
|
|
|
|
func IsAppendEventError(err error) bool {
|
|
|
|
_, ok := err.(AppendEventError)
|
|
|
|
return ok
|
|
|
|
}
|