sophia_iri/
_error.rs

1//! Error and result type for IRI resolution.
2
3use thiserror::Error;
4
5/// Type alias for `Result` with default error `TermError`.
6///
7/// Can be used like `std::result::Result` as well.
8pub type Result<T, E = InvalidIri> = std::result::Result<T, E>;
9
10/// This error is raised when trying to parse an invalid IRI.
11#[derive(Debug, Error)]
12#[error("The given IRI '{0}' is not valid according to RFC3987")]
13pub struct InvalidIri(pub String);