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

Remove unnecessary unwrap/expect from codebase and improve error handling #140

Open
Tracked by #7
simonsan opened this issue Jan 29, 2024 · 1 comment · May be fixed by #202
Open
Tracked by #7

Remove unnecessary unwrap/expect from codebase and improve error handling #140

simonsan opened this issue Jan 29, 2024 · 1 comment · May be fixed by #202
Labels
A-errors Area: error handling needs improvement A-meta Area: Project wide C-enhancement Category: New feature or request

Comments

@simonsan
Copy link
Contributor

simonsan commented Jan 29, 2024

There are still a lot of instances of unwrap/expect within the code base of rustic_core.

We should activate the clippy lints: #![deny(clippy::expect_used)] and #![deny(clippy::unwrap_used)] and tackle this issue. If we want to use rustic_core for GUI and other things, it shouldn't panic in circumstances that we can fix with good error handling.

CC: rustic-rs/rustic#981

@simonsan simonsan added A-errors Area: error handling needs improvement A-meta Area: Project wide C-enhancement Category: New feature or request labels Jan 29, 2024
@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Jan 29, 2024
@simonsan simonsan removed the S-triage Status: Waiting for a maintainer to triage this issue/PR label Jan 29, 2024
@simonsan
Copy link
Contributor Author

simonsan commented Mar 10, 2024

Hetzner Storage Box via RClone:

"name" = "rustic-rs"
"operating_system" = "Windows 10.0.22631 (Windows 11 Professional) [64-bit]"
"crate_version" = "0.7.0-dev"
"explanation" = '''
Panic occurred in file 'C:\Users\dailyuse\.cargo\git\checkouts\rustic_core-fa42f42e094d79df\07c75ed\crates\core\src\commands\check.rs' at line 124
'''
"cause" = """
called `Result::unwrap()` on an `Err` value: backoff failed: Permanent(reqwest::Error { kind: Status(404), url: Url { scheme: \"http\", cannot_be_a_base: false, username: \"\", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(61858), path: \"/data/f67d10627edb832163973a7afa4dcd3c5ecb97bdd80bafe1cdf45a589b1816c5\", query: None, fragment: None } })

Caused by:
    HTTP status client error (404 Not Found) for url (http://127.0.0.1:61858/data/f67d10627edb832163973a7afa4dcd3c5ecb97bdd80bafe1cdf45a589b1816c5)"""
"method" = "Panic"
"backtrace" = """

   0: 0x7ff74988d803 - <unresolved>
   1: 0x7ff7495528f9 - <unresolved>
   2: 0x7ff749552f21 - <unresolved>
   3: 0x7ff74989e319 - <unresolved>
   4: 0x7ff7490c9b03 - <unresolved>
   5: 0x7ff7490c9764 - <unresolved>
   6: 0x7ff74977205b - <unresolved>
   7: 0x7ffa9bc2257d - BaseThreadInitThunk
   8: 0x7ffa9d32aa58 - RtlUserThreadStart"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-errors Area: error handling needs improvement A-meta Area: Project wide C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant