Make error reporting more robust to panic
This commit is contained in:
parent
21e3a08b0e
commit
e0c0acffeb
4 changed files with 30 additions and 15 deletions
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
// commands
|
||||
"github.com/apex/log"
|
||||
|
||||
_ "github.com/ooni/probe-cli/internal/cli/geoip"
|
||||
_ "github.com/ooni/probe-cli/internal/cli/info"
|
||||
|
|
@ -14,17 +13,11 @@ import (
|
|||
_ "github.com/ooni/probe-cli/internal/cli/show"
|
||||
_ "github.com/ooni/probe-cli/internal/cli/upload"
|
||||
_ "github.com/ooni/probe-cli/internal/cli/version"
|
||||
"github.com/ooni/probe-cli/internal/crashreport"
|
||||
|
||||
"github.com/ooni/probe-cli/internal/cli/app"
|
||||
"github.com/ooni/probe-cli/internal/crashreport"
|
||||
)
|
||||
|
||||
func main() {
|
||||
crashreport.CapturePanicAndWait(func() {
|
||||
err := app.Run()
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
log.WithError(err).Fatal("main exit")
|
||||
}, nil)
|
||||
crashreport.CapturePanicAndWait(app.Run, nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue