xhttperror

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpCodeError

type HttpCodeError struct {
	// contains filtered or unexported fields
}

func (*HttpCodeError) Error

func (e *HttpCodeError) Error() string

func (*HttpCodeError) StatusCode

func (e *HttpCodeError) StatusCode() int

StatusCode returns the HTTP status code.

type HttpJsonError

type HttpJsonError struct {
	Message interface{}
	// contains filtered or unexported fields
}

func (*HttpJsonError) Error

func (e *HttpJsonError) Error() string

func (*HttpJsonError) StatusCode

func (e *HttpJsonError) StatusCode() int

StatusCode returns the HTTP status code.

type XHTTPError

type XHTTPError interface {
	error
	// StatusCode returns the HTTP status code of the error
	StatusCode() int
}

HTTPError represents an HTTP error with HTTP status code and error message

func NewHTTPStatusCodeError

func NewHTTPStatusCodeError(status int) XHTTPError

NewHTTPStatusCodeError creates a new HttpError instance. to generate the message based on the status code.

func NewJsonHTTPError

func NewJsonHTTPError(status int, message interface{}) XHTTPError

NewJsonHTTPError creates a new HttpError instance. to generate the message based on the status code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL