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