diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2017-05-09 20:13:59 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2017-05-09 20:13:59 +0200 |
| commit | 0e56e63c833229ca02f2c62d4ee50cf371b6ac9a (patch) | |
| tree | 0d69271229ca15b98e55d75b3b8936675aa25fcd /main.go | |
| parent | 2f93c6ca308a15c5d3e280274bd698604276143c (diff) | |
| download | gofu-0e56e63c833229ca02f2c62d4ee50cf371b6ac9a.tar.gz | |
replace panic() by a collector for early errors
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -24,6 +24,7 @@ import ( "path/filepath" "github.com/majewsky/gofu/pkg/cli" + "github.com/majewsky/gofu/pkg/earlyerrors" "github.com/majewsky/gofu/pkg/rtree" ) @@ -33,6 +34,14 @@ func main() { fmt.Fprintln(os.Stderr, "FATAL: initialization failed") os.Exit(255) } + + if len(earlyerrors.Get()) > 0 { + for _, msg := range earlyerrors.Get() { + ci.ShowError(msg) + } + os.Exit(255) + } + os.Exit(execApplet(ci, filepath.Base(os.Args[0]), os.Args[1:], true)) } |
