mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-28 23:18:54 +00:00
add error pkg
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user