Discover Packages
github.com/jaredhughes1012/parcel
httperror
package
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Jul 7, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Creates a new error with a format string
Unwraps an http error to get the internal error and http status code. If the
error is not an http error returns InternalServerError and a nil wrapped error
Wraps an existing error with an http status code
type HttpError struct {
Status int `json:"status"`
Message string `json:"message"`
}
Error containing an internal error and corresponding http response data
Checks if the error is an http error. If it is, returns it cast as an HttpError
If not, provides a new wrapped http error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.