Skip to content

Commit

Permalink
ledger-tool: Use error handling in blockstore command code (solana-la…
Browse files Browse the repository at this point in the history
…bs#35157)

There are lots of operations that could fail, including lots of the
Blockstore calls. The old code matched on Ok(_) or did unwrap()'s
which clutter the code and increase indentation.

This change wraps the entire command in a function that returns a
Result. The wrapper then does a single unwrap_or_else() and prints
any error message. Everywhere else is now free to use the ? operator
  • Loading branch information
steviez authored Feb 22, 2024
1 parent 07955e7 commit bfcd4c8
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 164 deletions.
Loading

0 comments on commit bfcd4c8

Please sign in to comment.