+// dontPanic recovers and logs panics instead of crashing
+// TODO: remove this after known issues are fixed
+func dontPanic(logger *zap.SugaredLogger) {
+ if r := recover(); r != nil {
+ fmt.Println("stacktrace from panic: \n" + string(debug.Stack()))
+ logger.Errorw("PANIC", "err", r, "trace", string(debug.Stack()))
+ }
+}
+