peroxide: Fix top-level error checking

Issue #6
create-reload-action
Lukasz Janyst 4 years ago
parent feee18b1f6
commit fd358aecc9
No known key found for this signature in database
GPG Key ID: 32DE641041F17A9A
  1. 8
      cmd/peroxide/main.go

@ -19,6 +19,7 @@ package main
import (
"flag"
"os"
"github.com/ljanyst/peroxide/pkg/bridge"
"github.com/ljanyst/peroxide/pkg/files"
@ -36,12 +37,13 @@ func main() {
b := &bridge.Bridge{}
err := b.Configure(*config)
if err != nil {
if err := b.Configure(*config); err != nil {
logrus.WithError(err).Fatal("Failed to configure the bridge")
os.Exit(1)
}
if b.Run(); err != nil {
if err := b.Run(); err != nil {
logrus.WithError(err).Fatal("Bridge exited with error")
os.Exit(1)
}
}

Loading…
Cancel
Save