errs

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONWriter

func JSONWriter(w http.ResponseWriter, r *http.Request, code int, err error, logger zerolog.Logger)

JSONWriter writes a swagger-compliant error response.

Types

type ErrorWriter

type ErrorWriter func(w http.ResponseWriter, code int, err error, logger zerolog.Logger)

ErrorWriter is the function definition called when writing a HTTP error.

type HTTPError added in v0.0.12

type HTTPError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

HTTPError definition.

Jump to

Keyboard shortcuts

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