api

package
v0.0.0-...-c33e8bb Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPError

func NewHTTPError(err error, status int, detail string) error

NewHTTPError ...

Types

type ClientError

type ClientError interface {
	Error() string
	// ResponseHeaders returns http status code and headers.
	ResponseHeaders() (int, map[string]string)
}

ClientError is an error whose details to be shared with client.

type HTTPError

type HTTPError struct {
	Cause  error  `json:"-"`
	Detail string `json:"detail"`
	Status int    `json:"-"`
}

HTTPError implements ClientError interface.

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) ResponseHeaders

func (e *HTTPError) ResponseHeaders() (int, map[string]string)

ResponseHeaders returns http status code and headers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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