Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Returns ArchiveSnapshotPackageError from archive_snapshot_package() #34855

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Jan 19, 2024

Problem

The fs-err create does not include source errors when displaying the error. The solana repo's convention is to include the source error in the message, so we end up losing the underlying cause of an IO error if fs_err is used.

Here's more info about the issue that I raised on the fs-err repo: andrewhickman/fs-err#51. Turns out their behavior is desired, and likely the most idiomatically correct Rust way. But we're not going to change the solana repo's error reporting anytime soon. Instead, we should replace the use of fs-err with regular std::fs.

Related: #34799

Summary of Changes

Replace fs-err in archive_snapshot_package() with a new error, ArchiveSnapshotPackageError.

@brooksprumo brooksprumo self-assigned this Jan 19, 2024
@brooksprumo brooksprumo marked this pull request as ready for review January 19, 2024 14:54
@brooksprumo brooksprumo requested a review from HaoranYi January 19, 2024 14:55
Copy link
Contributor

@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

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 59 lines in your changes are missing coverage. Please review.

Comparison is base (9d13244) 81.7% compared to head (8c85ab5) 81.7%.
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34855     +/-   ##
=========================================
- Coverage    81.7%    81.7%   -0.1%     
=========================================
  Files         826      826             
  Lines      223114   223168     +54     
=========================================
- Hits       182335   182332      -3     
- Misses      40779    40836     +57     

@brooksprumo brooksprumo merged commit a915e2f into solana-labs:master Jan 19, 2024
35 checks passed
@brooksprumo brooksprumo deleted the snap/errors/archive-snapshot-package branch January 19, 2024 16:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants