Skip to content

Commit

Permalink
politeiavoter: Log errors in two unlogged error paths
Browse files Browse the repository at this point in the history
main() does not have a catch-all log for errors returned by _main(), so it is
the responsibility of _main() to print or log these for every error return.
  • Loading branch information
jrick authored and davecgh committed Jun 28, 2023
1 parent 7cef402 commit 77b71ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions politeiawww/cmd/politeiavoter/politeiavoter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,8 @@ func _main() error {
// Contact WWW
c, err := firstContact(shutdownCtx, cfg)
if err != nil {
err := fmt.Errorf("Network error: %v\n", err)
fmt.Fprintln(os.Stderr, err)
return err
}
// Close GRPC
Expand All @@ -1707,6 +1709,8 @@ func _main() error {
// block height to validate GPRC creds.
ar, err := c.wallet.Accounts(c.ctx, &pb.AccountsRequest{})
if err != nil {
err := fmt.Errorf("Error pulling wallet accounts: %v\n", err)
fmt.Fprintln(os.Stderr, err)
return err
}
log.Debugf("Current wallet height: %v", ar.CurrentBlockHeight)
Expand Down

0 comments on commit 77b71ad

Please sign in to comment.