openmeter / api /client /go /error.go
Leon4gr45's picture
Upload folder using huggingface_hub
048b1e8 verified
Raw
History Blame Contribute Delete
717 Bytes
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
}