-
Notifications
You must be signed in to change notification settings - Fork 16
/
errors.go
28 lines (22 loc) · 1.06 KB
/
errors.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
package utils
import "fmt"
// ErrMarshalJSON returns an error when it failed in marshaling JSON
func ErrMarshalJSON(errMsg string) error {
return fmt.Errorf("failed. marshal JSON error: %s", errMsg)
}
// ErrUnmarshalJSON returns an error when it failed in unmarshaling JSON
func ErrUnmarshalJSON(errMsg string) error {
return fmt.Errorf("failed. unmarshal JSON error: %s", errMsg)
}
// ErrClientQuery returns an error when client failed in query
func ErrClientQuery(errMsg string) error {
return fmt.Errorf("failed. client query error: %s", errMsg)
}
// ErrFilterDataFromBaseResponse returns an error when it failed to filter data from backend base response
func ErrFilterDataFromBaseResponse(kind, errMsg string) error {
return fmt.Errorf("failed. filter %s data from base response error: %s", kind, errMsg)
}
// ErrFilterDataFromListResponse returns an error when it failed to filter data from backend list response
func ErrFilterDataFromListResponse(kind, errMsg string) error {
return fmt.Errorf("failed. filter %s data from list response error: %s", kind, errMsg)
}