summaryrefslogtreecommitdiff
path: root/internal/proxy/recover.go
blob: 27338e91676eb2d606de428a9cb0831188d04a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package proxy

import (
	"runtime/debug"

	"github.com/shiv/internal/logger"
)

func recoverPanic(context string) {
	if r := recover(); r != nil {
		logger.Error("panic in %s: %v\n%s", context, r, debug.Stack())
	}
}