use std::ffi::OsString; use strum::IntoStaticStr; use thiserror::Error; #[derive(Error, Debug, IntoStaticStr)] pub enum CreddyError { #[error("Couldn't determine location for app state")] DirNotFound, #[error("Invalid path: {0:?}")] InvalidPath(OsString), #[error("Error from database: {0}")] Db(#[from] duckdb::Error), #[error("I/O error: {0}")] Io(#[from] std::io::Error), #[error("Unable to hash password: {0}")] PasswordHash(#[from] argon2::Error), #[error("Unable to get random data: {0}")] Entropy(#[from] getrandom::Error), #[error("This database was created by a newer version of Creddy (unknown migration {0})")] DbTooNew(String), #[error("Migration {0} was applied before an earlier migration that hasn't been")] MigrationOutOfOrder(String), #[error("Invalid JSON: {0}")] InvalidJSON(#[from] serde_json::Error), #[error("Failed to bind socket: {0}")] SocketBind(String), #[error("Failed to get AWS session: {0}")] GetSession(String), #[error("Credential request was denied.")] RequestDenied, }