rusty_pwgen/error.rs
1//! Library-level error type for `rusty_pwgen`.
2
3#[non_exhaustive]
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6 /// A Default-mode-only setting was passed to Strict mode (or vice versa).
7 #[error("compatibility violation: {0}")]
8 CompatibilityViolation(&'static str),
9
10 /// The builder was configured into an impossible state.
11 #[error("invalid builder configuration: {0}")]
12 InvalidBuilderConfiguration(&'static str),
13
14 /// `-H` seed source could not be read (file not found, permission, etc.).
15 #[error("seed file not found or unreadable: {0}")]
16 SeedSourceUnavailable(String),
17
18 /// An underlying IO error.
19 #[error("IO error: {0}")]
20 Io(#[from] std::io::Error),
21}