Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses anyhow in accounts-hash-cache-tool #4233

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

brooksprumo
Copy link

Problem

The agave-hash-cache-tool provides displays messages on errors. This could be even more helpful by using anyhow.

Additionally, this reduces developer burden to manually handle displaying error messages correctly.

Summary of Changes

Use anyhow::Result<_> instead of std::result::Result<_, String>.

Here's an example of the output:

$ agave-accounts-hash-cache-tool diff files bad-file1 bad-file2
Error: 'diff files' failed

Caused by:
    0: failed to extract entries from file 1
    1: failed to open accounts hash cache file 'bad-file1'
    2: No such file or directory (os error 2)

@brooksprumo brooksprumo self-assigned this Jan 2, 2025
@brooksprumo brooksprumo marked this pull request as ready for review January 2, 2025 16:17
Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@brooksprumo brooksprumo merged commit 1769310 into anza-xyz:master Jan 3, 2025
51 checks passed
@brooksprumo brooksprumo deleted the hash-cache-tool/anyhow branch January 3, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants