forked from jthornber/thin-provisioning-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[thin_dump] Prompt for repair on input errors
thin_dump should display the repairing hint if there's any error in the input metadata rather than the output process. A context object thus is added to the returned error for callers to determine the error type. Note that a broken pipe error (EPIPE) is treated as an output error since the Rust std library ignores SIGPIPE by default [1][2]. [1] rust-lang/rust#13158 [2] rust-lang/rust#62569
- Loading branch information
Showing
4 changed files
with
61 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//------------------------------------------ | ||
|
||
// A wrapper for callers to determine the error type | ||
#[derive(Debug)] | ||
pub struct OutputError; | ||
|
||
impl std::fmt::Display for OutputError { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
write!(f, "output error") | ||
} | ||
} | ||
|
||
//------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters