We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cause
1 parent b12b4e4 commit 8f99ad2Copy full SHA for 8f99ad2
src/doc/book/error-handling.md
@@ -2019,6 +2019,16 @@ impl Error for CliError {
2019
CliError::NotFound => "not found",
2020
}
2021
2022
+
2023
+ fn cause(&self) -> Option<&error::Error> {
2024
+ match *self {
2025
+ CliError::Io(ref err) => Some(err),
2026
+ CliError::Parse(ref err) => Some(err),
2027
+ // Our custom error doesn't have an underlying cause, but we could
2028
+ // modify it so that it does.
2029
+ CliError::NotFound() => None,
2030
+ }
2031
2032
2033
```
2034
0 commit comments