apierrors

package
v0.0.0-...-76fc54f Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// The timestamp of the error.
	// in: body
	// required: true
	Timestamp string `json:"timestamp"`
	// The HTTP status code.
	// in: body
	// required: true
	Status int `json:"status"`
	// The status error message.
	// in: body
	// required: true
	ErrMsg string `json:"error"`
	// The error message.
	// in: body
	// required: true
	Message string `json:"message"`
}

APIError is the error response for the API.

swagger:model APIError

func NewAPIError

func NewAPIError(status int, err error) *APIError

NewAPIError returns a new APIError.

func NewBadRequestError

func NewBadRequestError(err error) *APIError

NewBadRequestError returns a new bad request error.

func NewInternalServerError

func NewInternalServerError(err error) *APIError

NewInternalServerError returns a new internal server error.

func NewNotFoundError

func NewNotFoundError(err error) *APIError

NewNotFoundError returns a new not found error.

func NewUnauthorizedError

func NewUnauthorizedError(err error) *APIError

NewUnauthorizedError returns a new unauthorized error.

func (*APIError) Error

func (e *APIError) Error() string

Jump to

Keyboard shortcuts

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