mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 08:59:44 +08:00
change: print panic trace
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/httprunner/hrp/cmd"
|
||||
)
|
||||
@@ -16,9 +14,11 @@ func main() {
|
||||
// report panic to sentry
|
||||
sentry.CurrentHub().Recover(err)
|
||||
sentry.Flush(time.Second * 5)
|
||||
log.Error().Interface("err", err).Msg("recover panic")
|
||||
os.Exit(1)
|
||||
|
||||
// print panic trace
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
cmd.Execute()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user