Expand description
§facet-error
A thiserror replacement powered by facet reflection.
§Usage
ⓘ
use facet::Facet;
use facet_error as error;
#[derive(Facet, Debug)]
#[facet(derive(Error))]
pub enum MyError {
/// data store disconnected
#[facet(error::from)]
Disconnect(std::io::Error),
/// invalid header (expected {expected}, found {found})
InvalidHeader { expected: String, found: String },
/// unknown error
Unknown,
}This generates:
impl Display for MyErrorusing doc comments as format stringsimpl Error for MyErrorwith propersource()implementationimpl From<std::io::Error> for MyErrorfor variants with#[facet(error::from)]
Macros§
- __
facet_ invoke - Plugin chain entry point.
Enums§
- Attr
- Error attribute types for field configuration.