mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
37 lines
739 B
Go
37 lines
739 B
Go
package sdk
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
)
|
|
|
|
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
|
|
}
|