Documentation
¶
Overview ¶
package fault provides a net/http handler for logging errors and rendering them to the browser using custom templates.
Index ¶
- Constants
- func AssignError(req *http.Request, err error, status int) *http.Request
- func FaultHandler(l *log.Logger) (http.Handler, error)
- func RetrieveError(req *http.Request) (int, error)
- func TemplatedFaultHandler(l *log.Logger, t *template.Template) (http.Handler, error)
- type FaultError
- type FaultHandlerVars
Constants ¶
View Source
const ErrorKey string = "github.com/sfomuseum/go-http-fault#error"
View Source
const StatusKey string = "github.com/sfomuseum/go-http-fault#status"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FaultError ¶ added in v0.0.4
type FaultError interface { error // Public returns an `error` instance whose string value is considered safe for publishing in a public setting or context. Public() error // Private returns an `error` instance whose string value that may contain details not suitable for publishing in a public setting or context. Private() error }
FaultError is an interface for providing custom public and private error messages.
type FaultHandlerVars ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.