panichandler

package module
v0.0.0-...-2743cbb Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: MIT Imports: 1 Imported by: 0

README

panichandler

Panic handler for FastHTTP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanicHandler

func PanicHandler(handler fasthttp.RequestHandler, onRecover PanicRecoveryHandler) fasthttp.RequestHandler

PanicHandler wraps original request handler with custom panic recovery logic (`PanicRecoveryHandler`)

func SimplePanicHandler

func SimplePanicHandler(handler fasthttp.RequestHandler) fasthttp.RequestHandler

SimplePanicHandler covers the most simple case when FastHTTP server needs to return HTTP 500 on unhandled panics.

Types

type PanicRecoveryHandler

type PanicRecoveryHandler func(ctx *fasthttp.RequestCtx, recoverDetails interface{})

PanicRecoveryHandler is an extension of standard fasthttp.RequestHandler.

`recoverDetails` contains all the details from 'recover()' call.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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