1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-25 22:32:23 +02:00

Middleware interface

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-02-07 23:02:37 -08:00
parent f27de9a804
commit 65fcca2ce3
8 changed files with 74 additions and 54 deletions

View File

@@ -10,9 +10,9 @@ import (
// Recover returns a middleware which recovers from panics anywhere in the chain
// and handles the control to the centralized HTTPErrorHandler.
func Recover() echo.MiddlewareFunc {
// TODO: Provide better stack trace `https://github.com/go-errors/errors` `https://github.com/docker/libcontainer/tree/master/stacktrace`
func Recover() MiddlewareFunc {
return func(h echo.HandlerFunc) echo.HandlerFunc {
// TODO: Provide better stack trace `https://github.com/go-errors/errors` `https://github.com/docker/libcontainer/tree/master/stacktrace`
return func(c echo.Context) error {
defer func() {
if err := recover(); err != nil {