Documentation
¶
Index ¶
Constants ¶
View Source
const ( SentryErrorCode = "error_code" SentryOperations = "operations" SentryRequestID = "request_id" )
sentry keys
Variables ¶
View Source
var ( // ErrNotSupported the requested action/resource is not supported ErrNotSupported = New(nil, NotSupported, "not supported") // ErrNotImplemented the requested action/resource is not implemented ErrNotImplemented = New(nil, NotImplemented, "not implemented") )
Functions ¶
func CaptureError ¶
CaptureError captures an error to sentry & set level as error
func CaptureWarning ¶
CaptureWarning captures an error to sentry & set level as warning
func WrapGORMError ¶
WrapGORMError wraps an GORM error into our error such as adding errors.Kind
Types ¶
type FieldError ¶
type FieldError struct {
validator.FieldError
}
FieldError is wrapper of validator.FieldError
func (FieldError) String ¶
func (e FieldError) String() string
type Kind ¶
type Kind int
Kind error kind
const ( BadRequest Kind = http.StatusBadRequest Conflict Kind = http.StatusConflict Forbidden Kind = http.StatusForbidden NotFound Kind = http.StatusNotFound Unprocessable Kind = http.StatusUnprocessableEntity TooManyRequests Kind = http.StatusTooManyRequests Unexpected Kind = http.StatusInternalServerError Retry Kind = -1 // Retry indicate an error we need to retry the action NotSupported Kind = -2 // NotSupported THe requested action/resource is not supported NotImplemented Kind = -3 // NotImplemented The requested action/resource is not implemented )
error kinds
Click to show internal directories.
Click to hide internal directories.