Documentation ¶
Index ¶
- func NewAPIError(status int, message string) error
- func NewAPIErrorF(status int, format string, a ...interface{}) error
- func NewAPIErrorWithCause(message string, cause error) error
- func NewBadRequestErrorF(format string, a ...interface{}) error
- func NewNotFoundErrorF(format string, a ...interface{}) error
- func NewUnauthorizedErrorF(format string, a ...interface{}) error
- type APIError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIError ¶
func NewAPIErrorF ¶
func NewAPIErrorWithCause ¶
func NewBadRequestErrorF ¶
func NewNotFoundErrorF ¶
func NewUnauthorizedErrorF ¶
Types ¶
type APIError ¶
type APIError struct { Status int `json:"code"` // HTTP status code Message string `json:"message"` // human-readable message RequestID string `json:"requestID,omitempty"` // ID to identify the request that caused this error OriginalError error `json:"-"` }
func AsAPIError ¶ added in v0.5.2
func NewInternalServerError ¶
func UnwrapAPIError ¶
UnwrapAPIError returns an API Error if one exists in the given error's chain or nil if no API Error exists in the chain.
Click to show internal directories.
Click to hide internal directories.