Use function to determine which functions to skip

This commit is contained in:
Michal Horejsek
2020-12-02 13:07:02 +01:00
parent 2100e2ff7c
commit 33dfc5ce09
4 changed files with 66 additions and 12 deletions

View File

@ -26,6 +26,7 @@ import (
"github.com/ProtonMail/proton-bridge/internal/frontend"
"github.com/ProtonMail/proton-bridge/pkg/config"
"github.com/ProtonMail/proton-bridge/pkg/sentry"
"github.com/urfave/cli"
)
@ -92,6 +93,8 @@ type PanicHandler struct {
// HandlePanic should be called in defer to ensure restart of app after error.
func (ph *PanicHandler) HandlePanic() {
sentry.SkipDuringUnwind()
r := recover()
if r == nil {
return