rescue

package
v0.0.0-...-1535236 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(handler ErrorHandler) medium.Middleware

Middleware accepts an ErrorHandler and returns a medium.Middleware that will rescue errors that happen in middlewares that are called after it.

Types

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error)

An ErrorHandler is a function that is called when an error occurs.

type Logger

type Logger interface {
	Errorf(format string, v ...any)
	Fatalf(format string, v ...any)
}

Logger interface that is required by the middleware.

Jump to

Keyboard shortcuts

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