Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrQueue ¶
ErrQueue is a helper struct for allowing xerrors to go along well with tree-structured errors
func NewErrQueue ¶
type ErrType ¶
type ErrType uint
Based on https://cloud.google.com/storage/docs/json_api/v1/status-codes#http-status-and-error-codes
const ( // 400 BadRequest ErrType = iota InvalidAltVaule InvalidArgument InvalidParameter ParseError Required TurnedDown // 401 AuthenticationError NotAuthenticated NotAuthorized // 403 AccountDisabled CountryBlocked Forbidden InsufficientPermissions SSLRequired // 404 NotFound // 405 MethodNotAllowed // 409 Conflict // 410 Gone // 411 LengthRequired // 412 ConditionNotMet // 413 PayloadTooLarge // 416 RequestedRangeNotSatisfiable // 429 RateLimitExceeded UserRateLimitExceeded // 500 InternalServerError // 502 BadGateway ServiceUnavailable )
type HTTPErr ¶
type HTTPErr struct { ErrDoc HTTPErrDoc `json:"error"` // contains filtered or unexported fields }
func NewHTTPErr ¶
type HTTPErrDoc ¶
type HTTPErrDoc struct { Errors []*InnerErr `json:"errors"` Code int `json:"code" example:"429"` Message string `json:"message" example:"Rate Limit Exceeded"` // contains filtered or unexported fields }
func (HTTPErrDoc) Error ¶
func (e HTTPErrDoc) Error() string
func (HTTPErrDoc) FormatError ¶
func (e HTTPErrDoc) FormatError(p xerrors.Printer) error
func (HTTPErrDoc) Unwrap ¶
func (e HTTPErrDoc) Unwrap() error
type InnerErr ¶
type InnerErr struct { Domain string `json:"domain" example:"usage"` // global, {yourService}, usage,... Reason string `json:"reason" example:"rateLimitExceeded"` // invalidParameter, required,... Location string `json:"location" example:""` // Authorization, {paramName},... LocationType string `json:"locationType" example:""` // header, parameter,... Message string `json:"message" example:"Rate Limit Exceeded"` // {description} Cause error `json:"-"` // For error reporting // contains filtered or unexported fields }
func NewInnerErr ¶
Click to show internal directories.
Click to hide internal directories.