errors

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHTTPBadRequest

func SendHTTPBadRequest(rw http.ResponseWriter, code Code, err error)

SendHTTPBadRequest sends http status code BAD REQUEST to response with given error body

func SendHTTPInternalServerError

func SendHTTPInternalServerError(rw http.ResponseWriter, code Code, err error)

SendHTTPInternalServerError sends http status code INTERNAL SERVER ERROR to response with given error body

func SendHTTPStatusError

func SendHTTPStatusError(rw http.ResponseWriter, code Code, err error, statusCode int)

SendHTTPStatusError sends given http status code to response with error body

func SendUnknownError

func SendUnknownError(rw http.ResponseWriter, err error)

SendUnknownError sends unnknown/default error through response with given error body

Types

type Code

type Code int32

Code is the error code of aries rest api errors

const (
	// UnknownStatus default error code for unknown errors
	UnknownStatus Code = iota
)

type Group

type Group int32

Group is the error groups. Note: recommended to use [0-9]*000 pattern for any new entries Example: 2000, 3000, 4000 ...... 25000

const (
	// Common error group for general rest api errors
	Common Group = 1000

	// DIDExchange error group for DID exchange protocol rest api errors
	DIDExchange Group = 2000

	// Introduce error group for Introduce protocol rest api errors
	Introduce Group = 3000
)

Jump to

Keyboard shortcuts

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