summaryrefslogtreecommitdiff
path: root/internal/proxy/recover.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/proxy/recover.go')
-rw-r--r--internal/proxy/recover.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/proxy/recover.go b/internal/proxy/recover.go
new file mode 100644
index 0000000..27338e9
--- /dev/null
+++ b/internal/proxy/recover.go
@@ -0,0 +1,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())
+ }
+}