apierror

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// STATUS CODE: 500
	InternalServerErr = APIError{
		StatusCode: http.StatusInternalServerError,
	}

	// STATUS CODE: 401
	UnauthorizedRequestErr = APIError{
		StatusCode: http.StatusUnauthorized,
	}

	// STATUS CODE: 403
	ForbiddenErr = APIError{
		StatusCode: http.StatusForbidden,
	}

	// STATUS CODE: 404
	EntityNotFoundErr = APIError{
		StatusCode: http.StatusNotFound,
	}

	// STATUS CODE: 400
	JSONInvalidErr = APIError{
		Code:       30000,
		StatusCode: http.StatusBadRequest,
		Message:    "JSON specified as a request is invalid",
	}
	SnapshotIncorrectErr = APIError{
		Code:       30001,
		StatusCode: http.StatusBadRequest,
		Message:    "Request snapshot invalid",
	}
)

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code       int    `json:"code"`
	Message    string `json:"message"`
	StatusCode int    `json:"-"`
}

func (APIError) Error

func (err APIError) Error() string

Jump to

Keyboard shortcuts

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