Skip to main content

better_url/errors/
path.rs

1//! Path stuff.
2
3use thiserror::Error;
4
5use crate::prelude::*;
6
7/// Returned when attempting to get a segmented path from an opaque path.
8#[derive(Debug, Error)]
9#[error("Attempted to get a segmented path from an opaque path.")]
10pub struct PathIsOpaque;
11
12/// Returned when failing to set some/all of a path.
13#[derive(Debug, Error)]
14pub enum SetPathError {
15    /** [`InsertNotFound`]. */ #[error(transparent)] InsertNotFound(#[from] InsertNotFound),
16    /** [`RangeNotFound`].  */ #[error(transparent)] RangeNotFound (#[from] RangeNotFound ),
17    /** [`CantBeEmpty`].    */ #[error(transparent)] CantBeEmpty   (#[from] CantBeEmpty   ),
18    /** [`PathIsOpaque`].   */ #[error(transparent)] PathIsOpaque  (#[from] PathIsOpaque  ),
19    /** [`TooLong`].        */ #[error(transparent)] TooLong       (#[from] TooLong       ),
20}