diff --git a/cmd/vidforward/main.go b/cmd/vidforward/main.go index 5a5732d2..94bafc41 100644 --- a/cmd/vidforward/main.go +++ b/cmd/vidforward/main.go @@ -41,6 +41,7 @@ import ( "strings" "sync" "time" + "runtime/debug" "bitbucket.org/ausocean/av/cmd/vidforward/global" "bitbucket.org/ausocean/av/container/mts" @@ -290,7 +291,12 @@ func (m *broadcastManager) recv(w http.ResponseWriter, r *http.Request) { // control handles control API requests. func (m *broadcastManager) control(w http.ResponseWriter, r *http.Request) { done := m.dogNotifier.handlerInvoked("control") - defer done() + defer func(){ + if r := recover(); r != nil { + m.log.Error("panicked in control request!","error",r.(error).Error(),"stack",string(debug.Stack())) + } + done() + }() m.log.Info("control request", "method", r.Method) switch r.Method {