mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 15:19:14 +00:00
Init (#17)
* add basic gitignore * init go mod * add semrel and badges * add error pkg * added config pkg * added main cmd structure * return error on file not found and added log ids and messages * add todo for error_creator.go
This commit is contained in:
18
internal/errors/error.go
Normal file
18
internal/errors/error.go
Normal file
@@ -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