fault

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: BSD-3-Clause Imports: 6 Imported by: 1

README

go-http-fault

Go package providing a net/http handler for logging errors and rendering them to the browser using custom templates.

Documentation

Go Reference

Documentation is incomplete at this time.

Documentation

Overview

package fault provides a net/http handler for logging errors and rendering them to the browser using custom templates.

Index

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

func AssignError

func AssignError(req *http.Request, err error, status int) *http.Request

func FaultHandler

func FaultHandler(l *log.Logger) (http.Handler, error)

func RetrieveError added in v0.0.2

func RetrieveError(req *http.Request) (int, error)

func TemplatedFaultHandler added in v0.0.2

func TemplatedFaultHandler(l *log.Logger, t *template.Template) (http.Handler, error)

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

type FaultHandlerVars struct {
	Status int
	Error  error
}

Jump to

Keyboard shortcuts

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