This repository was archived by the owner on Aug 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
39 lines (36 loc) · 1.71 KB
/
Copy patherrors.go
File metadata and controls
39 lines (36 loc) · 1.71 KB
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
package errors
var (
// NotFound is used when a resource is not found
NotFound = New("not found")
// NotValid indidcates a general invalid error
NotValid = New("not valid")
// NotValidRequest indicates that something other than a requests body is invalid
// for example, if a request is on http protocol, maybe a header, or query parameter
// is invalid
NotValidRequest = New("not valid request")
// NotValidRequestData indicates that a request is valid, but the data
// provided in the request is invalid
NotValidRequestData = New("not valid request data")
// NotValidInternalData indicates a successful request, but that the application
// data is malformed
NotValidInternalData = New("not valid internal data")
// NotDeserializable indicates provided or internal data was not successfully deserialized to
// application data structures
NotDeserializable = New("not deserializable")
// NotSerializable indicates provided or internals data was not successfully serialized to
// application interface data structures
NotSerializable = New("not serializable")
// NoRelationshipFound indicates that a process which assumes a data relationship did not find
// the assumed relationship
NoRelationshipFound = New("not relationship found")
// NotKnown indicates an application failure for which the failure is not known
NotKnown = New("not known")
// NotUnique indicates an expectations of uniqueness which is not met
NotUnique = New("not unique")
)
func WithErrorMessage(rootErr, withErr error, message string) error {
return WithMessage(WithError(rootErr, withErr), message)
}
func WrapWithErrorMessage(rootErr, withErr error, message, wrap string) error {
return Wrap(WithErrorMessage(rootErr, withErr, message), wrap)
}