rustic_core
rustic_core copied to clipboard
refactor(error)!: handle errors more gracefully in rustic_core.
Till now, rustic_core had a lot of unwraps and expects sprinkled over the code base. This made rustic_core and dependents panic in case of errors. This is unacceptable for a library, hence we fixed it now.
Fixes #140
TODO:
- [X] Implement unit tests for test coverage of some changes
- [x] Fix integration test
- [x]
0(*nix) errors left (due to unwrap/expect being denied)
Possible Panics left over/reintroduced:
HexId::as_str()/Id:to_hex(): Commit cc6430f4
Codecov Report
Attention: Patch coverage is 26.00000% with 444 lines in your changes missing coverage. Please review.
Project coverage is 27.5%. Comparing base (
fb291dc) to head (f1218c8). Report is 106 commits behind head on main.
Additional details and impacted files
| Files with missing lines | Coverage Δ | |
|---|---|---|
| crates/backend/src/choose.rs | 0.0% <ø> (ø) |
|
| crates/backend/src/opendal.rs | 0.0% <ø> (ø) |
|
| crates/backend/src/rclone.rs | 87.5% <ø> (+9.7%) |
:arrow_up: |
| crates/core/src/archiver/file_archiver.rs | 77.0% <ø> (ø) |
|
| crates/core/src/cdc/polynom.rs | 75.0% <ø> (ø) |
|
| crates/core/src/cdc/rolling_hash.rs | 54.3% <ø> (ø) |
|
| crates/core/src/chunker.rs | 58.6% <ø> (+0.7%) |
:arrow_up: |
| crates/core/src/crypto/aespoly1305.rs | 77.7% <ø> (-5.6%) |
:arrow_down: |
| crates/core/src/error.rs | 25.0% <ø> (+10.7%) |
:arrow_up: |
| crates/core/src/index/binarysorted.rs | 54.5% <ø> (-0.9%) |
:arrow_down: |
| ... and 36 more |
The CI fails for Test Coverage, I don't intend to write tests at this stage for the changes as I think we should focus on the other tests first, that we wanted to implement (e.g. path related stuff).
I don't want to implement these tests in this PR though, as it's already quite big.
OK, added some more testing, so the coverage test also runs through. 👍🏽
Closing this as it's heavily outdated.