Catch-all error for all errors that will be able to come up during handling of backup requests. For now it only has errors for blob client, but it will be expanded in the future diffs.
Details
Details
- Reviewers
bartek • patryk • jon - Commits
- rCOMM629559dad170: [backup] Introduce backup error
Create a service:
.service(web::resource("/hello").route(web::get().to( |blob: web::Data<BlobServiceClient>| async move { let _ = blob.get("asdasd").await.map_err(BackupError::from)?; Ok::<&str, BackupError>("world") }, )))
Test a few different scenarios: blob error not available (not running), blob not existing
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
services/backup/src/error.rs | ||
---|---|---|
28 ↗ | (On Diff #30327) | Btw - have you tested {err} vs {err:?} ? - Sometimes Debug is more meaningful and sometimes Display - I've never found a single good way. |
services/backup/src/error.rs | ||
---|---|---|
28 ↗ | (On Diff #30327) | Just tested it and it seems Display is fine. In this case (our own errors) I think we should try and keep the Display the preferred way (this is also why I prefer thiserror over derive_more because it requires you to be more explicit when it comes to the messages) |