diff --git a/pkg/lib/cron/cron.go b/pkg/lib/cron/cron.go index 805c7b8d8d..26e06bed95 100644 --- a/pkg/lib/cron/cron.go +++ b/pkg/lib/cron/cron.go @@ -71,6 +71,8 @@ func (c *Cron) Cancel() { func recoverer(errHandler func(error)) { if errInterface := recover(); errInterface != nil { - errHandler(errors.CastRecoverError(errInterface)) + err := errors.CastRecoverError(errInterface) + errors.PrintStacktrace(err) + errHandler(err) } } diff --git a/pkg/lib/exit/exit.go b/pkg/lib/exit/exit.go index 3ef5646939..78564a04bb 100644 --- a/pkg/lib/exit/exit.go +++ b/pkg/lib/exit/exit.go @@ -63,7 +63,6 @@ func Panic(err error, wrapStrs ...string) { func RecoverAndExit(strs ...string) { if errInterface := recover(); errInterface != nil { err := errors.CastRecoverError(errInterface, strs...) - errors.PrintErrorForUser(err) - os.Exit(1) + Panic(err) } } diff --git a/pkg/operator/endpoints/respond.go b/pkg/operator/endpoints/respond.go index a4f1f84ca7..f642f46999 100644 --- a/pkg/operator/endpoints/respond.go +++ b/pkg/operator/endpoints/respond.go @@ -63,6 +63,7 @@ func respondErrorCode(w http.ResponseWriter, r *http.Request, code int, err erro func recoverAndRespond(w http.ResponseWriter, r *http.Request, strs ...string) { if errInterface := recover(); errInterface != nil { err := errors.CastRecoverError(errInterface, strs...) + errors.PrintStacktrace(err) telemetry.Error(err) respondError(w, r, err) }