Documentation ¶
Index ¶
- Constants
- Variables
- func NewErrContractInvalidError(err error) *errContractInvalid
- func NewServiceClientHttpError(err error) *serviceClientHttpError
- type ErrorHandler
- type ErrorType
- type HTTPErrorResponse
- type Handler
- func (e *Handler) Handle(err error, ec ErrorType) HTTPErrorResponse
- func (e *Handler) HandleManyWithDefault(err error, allowableErrors []ErrorType, defaultError ErrorType) HTTPErrorResponse
- func (e *Handler) HandleWithDefault(err error, allowableError ErrorType, defaultError ErrorType) HTTPErrorResponse
Constants ¶
View Source
const (
METHOD_NOT_ALLOWED = "isA should not be invoked, this is to only be used as a default error"
)
Variables ¶
View Source
var Default defaultError
Functions ¶
func NewErrContractInvalidError ¶
func NewErrContractInvalidError(err error) *errContractInvalid
NewErrContractInvalid returns an instance of the error interface with ErrContractInvalid as its implementation.
func NewServiceClientHttpError ¶
func NewServiceClientHttpError(err error) *serviceClientHttpError
NewServiceClientHttpError represents the accessor for the service-client-specific error concepts
Types ¶
type ErrorHandler ¶
type ErrorHandler interface { Handle(err error, ec ErrorType) HTTPErrorResponse HandleWithDefault(err error, allowableError ErrorType, defaultError ErrorType) HTTPErrorResponse HandleManyWithDefault(err error, allowableErrors []ErrorType, defaultError ErrorType) HTTPErrorResponse }
func NewErrorHandler ¶
func NewErrorHandler(l logger.LoggingClient) ErrorHandler
type HTTPErrorResponse ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Handle ¶
func (e *Handler) Handle(err error, ec ErrorType) HTTPErrorResponse
Handle applies the specified error to the HTTP response writer
func (*Handler) HandleManyWithDefault ¶
func (e *Handler) HandleManyWithDefault(err error, allowableErrors []ErrorType, defaultError ErrorType) HTTPErrorResponse
HandleManyWithDefault applies general error-handling for the specified set of allowable errors and a default error to be used as a fallback when none of the allowable errors are matched
func (*Handler) HandleWithDefault ¶
func (e *Handler) HandleWithDefault(err error, allowableError ErrorType, defaultError ErrorType) HTTPErrorResponse
HandleWithDefault applies general error-handling with a single allowable error and a default error to be used as a fallback when none of the allowable errors are matched
Click to show internal directories.
Click to hide internal directories.