use uuid::Uuid;
#[derive(Debug, thiserror::Error)]
pub enum EphemeralError {
#[error("no tenant binding on the current session — bind a tenant first")]
NoTenantBinding,
#[error(
"ephemeral table name '{name}' is too long: logical names are limited to \
{max} characters so the session-prefixed id fits the 63-char table-id cap"
)]
NameTooLong { name: String, max: usize },
#[error("ephemeral table '{0}' already exists in this session")]
DuplicateTable(String),
#[error("ephemeral table '{0}' not found in this session")]
UnknownTable(String),
#[error(
"ephemeral session {session_id}: {failed}/{total} table drops failed on close \
(a partial_deletion_failure event was emitted)"
)]
PartialDeletionFailure {
session_id: Uuid,
failed: usize,
total: usize,
},
#[error("storage: {0}")]
Storage(String),
#[error("trigger broker: {0}")]
Broker(String),
#[error("serde: {0}")]
Serde(#[from] serde_json::Error),
}