mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
19 lines
395 B
Go
19 lines
395 B
Go
|
package errors
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// Error is a stdlib error extension.
|
||
|
// It contains parameters to identify errors through all application layers
|
||
|
type Error interface {
|
||
|
GetParent() error
|
||
|
GetMessage() string
|
||
|
GetID() string
|
||
|
}
|
||
|
|
||
|
// Contains compares the error message with needle
|
||
|
func Contains(err error, needle string) bool {
|
||
|
return err != nil && strings.Contains(err.Error(), needle)
|
||
|
}
|