Skip to content

Commit

Permalink
log fatal on config parse error (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh authored Sep 2, 2024
1 parent 07bea54 commit c2af15e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions relayer/cmd/run/beacon/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package beacon

import (
"context"
"fmt"
"log"
"os"
"os/signal"
Expand All @@ -21,7 +20,7 @@ var (
configFile string
privateKey string
privateKeyFile string
privateKeyID string
privateKeyID string
)

func Command() *cobra.Command {
Expand All @@ -39,7 +38,6 @@ func Command() *cobra.Command {
cmd.Flags().StringVar(&privateKeyFile, "substrate.private-key-file", "", "The file from which to read the private key URI")
cmd.Flags().StringVar(&privateKeyID, "substrate.private-key-id", "", "The secret id to lookup the private key in AWS Secrets Manager")


return cmd
}

Expand All @@ -62,7 +60,8 @@ func run(_ *cobra.Command, _ []string) error {

err = config.Validate()
if err != nil {
return fmt.Errorf("config file validation failed: %w", err)
logrus.WithError(err).Fatal("Configuration file validation failed")
return err
}

keypair, err := parachain.ResolvePrivateKey(privateKey, privateKeyFile, privateKeyID)
Expand Down

0 comments on commit c2af15e

Please sign in to comment.