recovery

package
v0.0.0-...-d7376be Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recovery

type Recovery struct {
	// Core is the core functionality for plugins
	plugins.Core

	// OnRecover is the custom panic recovery function supplied by
	// the user. If OnRecover is nil, the plugin will just bubble the
	// panic up
	OnRecover func(rMsg interface{}, c *verto.Context)
}

Recovery is a plugin that provides flexible, graceful panic recovery for web requests

func New

func New() *Recovery

New instantiates and returns a new instance of a Recovery plugin

func (*Recovery) Handle

func (plugin *Recovery) Handle(c *verto.Context, next http.HandlerFunc)

Handle is called per web request to protect from program panics. If the OnRecover function is supplied on the plugin, OnRecover will be called to handle program panics. Otherwise, Handle will just bubble the panic up

Jump to

Keyboard shortcuts

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