Documentation ¶
Index ¶
- func HandleAPIError(l logger.Logger, alerter erroralerter.Alerter, w http.ResponseWriter, ...)
- type ErrForbidden
- type ErrInternal
- type ErrNotFound
- type ErrPassThroughToClient
- type ErrorOpts
- type RequestError
- func NewErrForbidden(err error) RequestError
- func NewErrInternal(err error) RequestError
- func NewErrNotFound(err error) RequestError
- func NewErrPassThroughToClient(apiError types.APIError, statusCode int, details ...string) RequestError
- func NewErrPassThroughToClientMulti(apiErrors types.APIErrors, statusCode int, details ...string) RequestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAPIError ¶
func HandleAPIError( l logger.Logger, alerter erroralerter.Alerter, w http.ResponseWriter, r *http.Request, err RequestError, writeErr bool, opts ...ErrorOpts, )
Types ¶
type ErrForbidden ¶
type ErrForbidden struct {
// contains filtered or unexported fields
}
func (*ErrForbidden) APIError ¶
func (e *ErrForbidden) APIError() types.APIErrors
func (*ErrForbidden) Error ¶
func (e *ErrForbidden) Error() string
func (*ErrForbidden) GetStatusCode ¶
func (e *ErrForbidden) GetStatusCode() int
func (*ErrForbidden) InternalError ¶
func (e *ErrForbidden) InternalError() string
type ErrInternal ¶
type ErrInternal struct {
// contains filtered or unexported fields
}
func (*ErrInternal) APIError ¶
func (e *ErrInternal) APIError() types.APIErrors
func (*ErrInternal) Error ¶
func (e *ErrInternal) Error() string
func (*ErrInternal) GetStatusCode ¶
func (e *ErrInternal) GetStatusCode() int
func (*ErrInternal) InternalError ¶
func (e *ErrInternal) InternalError() string
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
errors that denote that a resource was not found
func (*ErrNotFound) APIError ¶
func (e *ErrNotFound) APIError() types.APIErrors
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
func (*ErrNotFound) GetStatusCode ¶
func (e *ErrNotFound) GetStatusCode() int
func (*ErrNotFound) InternalError ¶
func (e *ErrNotFound) InternalError() string
type ErrPassThroughToClient ¶
type ErrPassThroughToClient struct {
// contains filtered or unexported fields
}
errors that should be passed directly, with no filter
func (*ErrPassThroughToClient) APIError ¶
func (e *ErrPassThroughToClient) APIError() types.APIErrors
func (*ErrPassThroughToClient) Error ¶
func (e *ErrPassThroughToClient) Error() string
func (*ErrPassThroughToClient) GetStatusCode ¶
func (e *ErrPassThroughToClient) GetStatusCode() int
func (*ErrPassThroughToClient) InternalError ¶
func (e *ErrPassThroughToClient) InternalError() string
type RequestError ¶
type RequestError interface { Error() string APIError() types.APIErrors InternalError() string GetStatusCode() int }
func NewErrForbidden ¶
func NewErrForbidden(err error) RequestError
func NewErrInternal ¶
func NewErrInternal(err error) RequestError
func NewErrNotFound ¶
func NewErrNotFound(err error) RequestError
func NewErrPassThroughToClient ¶
func NewErrPassThroughToClient(apiError types.APIError, statusCode int, details ...string) RequestError
func NewErrPassThroughToClientMulti ¶
func NewErrPassThroughToClientMulti(apiErrors types.APIErrors, statusCode int, details ...string) RequestError
Click to show internal directories.
Click to hide internal directories.