mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 08:00:51 +00:00
Adds admin env file import/export (multipart upload + download), per-key spend alerts (80/95/100% of budget), model allowlist with wildcard support, audit log for admin mutations, CSRF one-time-use tokens, SSRF-safe OIDC/webhook clients, sliding-window admin rate limiter, and configurable Redis fail policy. Also updates batch_engine, client, translator mapping, and admin UI settings tab. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
934 B
Rust
43 lines
934 B
Rust
// crates/batch_engine/src/error.rs
|
|
//! Engine and queue error types.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Top-level error type returned by `BatchEngine` operations.
|
|
#[derive(Debug, Error)]
|
|
pub enum EngineError {
|
|
#[error("batch not found: {0}")]
|
|
NotFound(String),
|
|
|
|
#[error("file not found: {0}")]
|
|
FileNotFound(String),
|
|
|
|
#[error("validation error: {0}")]
|
|
Validation(String),
|
|
|
|
#[error("queue error: {0}")]
|
|
Queue(#[from] QueueError),
|
|
|
|
#[error("backend error: {0}")]
|
|
Backend(String),
|
|
}
|
|
|
|
/// Storage-layer errors returned by `JobQueue` and `WebhookQueue` implementations.
|
|
#[derive(Debug, Error)]
|
|
pub enum QueueError {
|
|
#[error("not found")]
|
|
NotFound,
|
|
|
|
#[error("already claimed")]
|
|
AlreadyClaimed,
|
|
|
|
#[error("storage error: {0}")]
|
|
Storage(String),
|
|
}
|
|
|
|
impl From<rusqlite::Error> for QueueError {
|
|
fn from(e: rusqlite::Error) -> Self {
|
|
QueueError::Storage(e.to_string())
|
|
}
|
|
}
|