forked from openmeterio/openmeter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror.go
More file actions
14 lines (12 loc) · 717 Bytes
/
error.go
File metadata and controls
14 lines (12 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package openmeter
// ErrResponse renderer type for handling all sorts of errors.
// In the best case scenario, the excellent github.com/pkg/errors package
// helps reveal information on the error, setting it on Err, and in the Render()
// method, using it to set the application-specific error code in AppCode.
type ErrResponse struct {
Err error `json:"-"` // low-level runtime error
StatusCode int `json:"statusCode"` // http response status code
StatusText string `json:"status"` // user-level status message
AppCode int64 `json:"code,omitempty"` // application-specific error code
Message string `json:"message,omitempty"` // application-level error message, for debugging
}