-
Notifications
You must be signed in to change notification settings - Fork 4
/
error.go
42 lines (38 loc) · 873 Bytes
/
error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package config
import "github.com/deepsourcelabs/hermes/domain"
type cfgError struct {
message string
internal string
statusCode int
systemCode string
isFatal bool
}
func NewErr(statusCode int, systemCode string, message string, internal string, isFatal bool) domain.IError {
return &cfgError{
message: message,
statusCode: statusCode,
systemCode: systemCode,
internal: internal,
isFatal: isFatal,
}
}
func (e *cfgError) Message() string {
return e.message
}
func (e *cfgError) IsFatal() bool {
return e.isFatal
}
func (e *cfgError) StatusCode() int {
return e.statusCode
}
func (e *cfgError) Error() string {
return e.internal
}
func (e *cfgError) SystemCode() string {
return e.systemCode
}
var (
errDBErr = func(internal string) domain.IError {
return NewErr(500, "HE-STO-50010", "something went wrong", internal, true)
}
)