summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/middleware/recover.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-12-07 23:00:56 +0100
committerWim <wim@42.be>2017-12-07 23:00:56 +0100
commit5c919e6bffbf5dbe057623323effdbed2e82189e (patch)
tree8e0130ea7387ac1a38c8ceb5b85de1f43435bbe0 /vendor/github.com/labstack/echo/middleware/recover.go
parent434393d1c3ade598bd38c98eefe7db93be4c9b27 (diff)
downloadmatterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.tar.gz
matterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.tar.bz2
matterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.zip
Update vendor labstack/echo
Diffstat (limited to 'vendor/github.com/labstack/echo/middleware/recover.go')
-rw-r--r--vendor/github.com/labstack/echo/middleware/recover.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/vendor/github.com/labstack/echo/middleware/recover.go b/vendor/github.com/labstack/echo/middleware/recover.go
index 96fa62c9..687a198a 100644
--- a/vendor/github.com/labstack/echo/middleware/recover.go
+++ b/vendor/github.com/labstack/echo/middleware/recover.go
@@ -5,7 +5,6 @@ import (
"runtime"
"github.com/labstack/echo"
- "github.com/labstack/gommon/color"
)
type (
@@ -64,17 +63,14 @@ func RecoverWithConfig(config RecoverConfig) echo.MiddlewareFunc {
defer func() {
if r := recover(); r != nil {
- var err error
- switch r := r.(type) {
- case error:
- err = r
- default:
+ err, ok := r.(error)
+ if !ok {
err = fmt.Errorf("%v", r)
}
stack := make([]byte, config.StackSize)
length := runtime.Stack(stack, !config.DisableStackAll)
if !config.DisablePrintStack {
- c.Logger().Printf("[%s] %s %s\n", color.Red("PANIC RECOVER"), err, stack[:length])
+ c.Logger().Printf("[PANIC RECOVER] %v %s\n", err, stack[:length])
}
c.Error(err)
}