diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-11 05:07:13 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-11 05:07:13 +0000 |
commit | 1e4cdde8a6b8edff8c559b149a0adc5d7faa9334 (patch) | |
tree | eb06821bbddbfa03cbbd4d43809f6ce410205f48 /README.md | |
parent | dabc91eb0030737ccdffe439c3fea499b33e4f5e (diff) | |
parent | a0b3187c100b0c81e2330b1b98983a1d08c22dff (diff) | |
download | thiserror-c440cb67425dfe37b7aba1c5ec5221baf45f93b4.tar.gz |
Snap for 8570526 from a0b3187c100b0c81e2330b1b98983a1d08c22dff to mainline-mediaprovider-releaseaml_mpr_331918000aml_mpr_331812020aml_mpr_331711020aml_mpr_331613010aml_mpr_331512020aml_mpr_331412040aml_mpr_331311080aml_mpr_331112050aml_mpr_331112030aml_mpr_331011070aml_mpr_330911040aml_mpr_330811020android13-mainline-mediaprovider-release
Change-Id: Ieac55a6c3efe793a431bc0ef03e6b880f5b3887c
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -137,6 +137,20 @@ pub enum DataStoreError { } ``` +- If a field is both a source (named `source`, or has `#[source]` or `#[from]` + attribute) *and* is marked `#[backtrace]`, then the Error trait's + `backtrace()` method is forwarded to the source's backtrace. + + ```rust + #[derive(Error, Debug)] + pub enum MyError { + Io { + #[backtrace] + source: io::Error, + }, + } + ``` + - Errors may use `error(transparent)` to forward the source and Display methods straight through to an underlying error without adding an additional message. This would be appropriate for enums that need an "anything else" variant. |