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

@ -57,6 +57,8 @@ var logCrashRgx = regexp.MustCompile("^v.*_crash_.*\\.log$") //nolint[gochecknog
// HandlePanic reports the crash to sentry or local file when sentry fails.
func HandlePanic(cfg *Config, output string) {
sentry.SkipDuringUnwind()
if !cfg.IsDevMode() {
apiCfg := cfg.GetAPIConfig()
if err := sentry.ReportSentryCrash(apiCfg.ClientID, apiCfg.AppVersion, apiCfg.UserAgent, errors.New(output)); err != nil {