internal

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoveryHandler

func RecoveryHandler(l *slog.Logger, er ErrorReporter) func(h http.Handler) http.Handler

RecoveryHandler is HTTP middleware that recovers from a panic, writes a 500, reports the panic, logs the panic and continues to the next handler.

Types

type ErrorReporter

type ErrorReporter interface {
	Report(errorreporting.Entry)
	io.Closer
}

ErrorReporter reports errors.

type NopErrorReporter

type NopErrorReporter struct{}

NopErrorReporter is a no-op reporter.

func (*NopErrorReporter) Close

func (r *NopErrorReporter) Close() error

Close implements ErrorReporter.

func (*NopErrorReporter) Report

func (r *NopErrorReporter) Report(e errorreporting.Entry)

Report implements ErrorReporter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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