package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Oct 17, 2020
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 3
Opens a new window with list of known importers.
README
¶
Errors
A simple utility for error handling in go/echo microservices
Documentation
¶
New is a drop in replacement for standar errors package
func Handler(err error, c echo.Context)
Handler serializes an error
Code is to make it easier to return a 400
type HTTPError interface {
GetStatusCode() int
}
HTTPError is an interface for structured errors
type Response struct {
StatusCode int `json:"-"`
Code string `json:"code,omitempty"`
Detail string `json:"detail,omitempty"`
}
Response is the default structure of an error response
GetStatusCode returns the status code
Source Files
¶
Click to show internal directories.
Click to hide internal directories.