Skip to content

Commit

Permalink
Additional error logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Apr 28, 2024
1 parent d09c40d commit 926a3ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (w *wallet) List(ctx context.Context, accountPath string) ([]e2wtypes.Accou
var release func()
conn, release, err = w.connectionProvider.Connection(ctx, w.endpoints[i])
if err != nil {
// Failed to obtain the connection.
w.log.Debug().Stringer("endpoint", w.endpoints[i]).Str("path", path).Err(err).Msg("Failed to obtain connection")
continue
}

Expand All @@ -127,6 +127,7 @@ func (w *wallet) List(ctx context.Context, accountPath string) ([]e2wtypes.Accou
// Success.
break
}
w.log.Debug().Stringer("endpoint", w.endpoints[i]).Str("path", path).Err(err).Msg("Failed to list accounts")
}
if err != nil {
return nil, errors.Wrap(err, "failed to access dirk")
Expand Down
4 changes: 3 additions & 1 deletion wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ func (w *wallet) Accounts(ctx context.Context) <-chan e2wtypes.Account {
ch := make(chan e2wtypes.Account, 1024)
go func() {
accounts, err := w.List(ctx, "")
if err == nil {
if err != nil {
w.log.Error().Err(err).Msg("Failed to obtain accounts")
} else {
for _, account := range accounts {
ch <- account
}
Expand Down

0 comments on commit 926a3ea

Please sign in to comment.