Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ pub enum DataStoreError {
// Private and free to change across minor version of the crate.
#[derive(Error, Debug)]
enum ErrorRepr {
...
#[error("invalid input")]
InvalidInput(#[from] InvalidInputError),
// Additional error variants can be added here
}
```

Expand Down
18 changes: 15 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,22 @@
//! // Private and free to change across minor version of the crate.
//! #[derive(Error, Debug)]
//! enum ErrorRepr {
//! # /*
//! ...
//! # */
//! #[error("invalid input")]
//! InvalidInput(#[from] InvalidInputError),
//! }
//! #
//! # #[derive(Error, Debug)]
//! # #[error("invalid input")]
//! # struct InvalidInputError;
//! #
//! # fn process() -> Result<(), ErrorRepr> {
//! # Err(InvalidInputError.into())
//! # }
//! #
//! # fn example() -> Result<(), PublicError> {
//! # process()?;
//! # Ok(())
//! # }
//! ```
//!
//! - See also the [`anyhow`] library for a convenient single error type to use
Expand Down