use serde::{Deserialize, Serialize};
use thiserror::Error;
#[derive(Debug, Clone, Error, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "kind", content = "detail")]
#[non_exhaustive]
pub enum UiError {
#[error("not_found: {0}")]
NotFound(String),
#[error("invalid: {0}")]
Invalid(&'static str),
#[error("capability_denied: required={required}")]
CapabilityDenied {
required: &'static str,
},
#[error("ledger_error: {reason_code}")]
LedgerError {
reason_code: &'static str,
},
#[error("secret_in_argv: server={server_id} rule={rule}")]
SecretInArgv {
server_id: String,
rule: &'static str,
},
#[error("profile_serialize_failed")]
ProfileSerializeFailed,
}