pub enum ApiError {
Show 31 variants
RunNotFound(Uuid),
StepNotFound(Uuid),
WorkflowNotFound(String),
BadRequest(String),
Conflict(String),
Unauthorized,
InvalidCredentials,
DuplicateEmail,
DuplicateUsername,
WeakPassword(PasswordPolicyError),
ApiKeyNotFound(Uuid),
UserNotFound(Uuid),
Forbidden,
SecretNotFound(String),
InsufficientScope,
IdempotencyKeyConflict(Uuid),
ConcurrencyConflict {
key: String,
run_id: Uuid,
},
MonthlyBudgetExceeded(String),
ArtifactNotFound(String),
ArtifactStorageUnavailable,
ArtifactTooLarge,
ScheduleNotFound(Uuid),
DelegationNotFound(Uuid),
ProviderAccountNotFound(String),
AccountCredentialRejected(String),
Store(StoreError),
Internal(String),
BadGateway(String),
RegistryNotFound,
RegistryUnreachable,
InvalidInput(Vec<String>),
}Expand description
Error type for REST API operations.
Maps to appropriate HTTP status codes and error codes in the JSON response.
§Examples
use ironflow_api::error::ApiError;
use uuid::Uuid;
let err = ApiError::RunNotFound(Uuid::nil());
assert_eq!(err.to_string(), "run not found");Variants§
RunNotFound(Uuid)
The requested run does not exist (404).
StepNotFound(Uuid)
The requested step does not exist (404).
WorkflowNotFound(String)
Workflow not found (404).
BadRequest(String)
Bad request: invalid input (400).
Conflict(String)
The request conflicts with the current state of the resource (409).
Authentication required (401).
InvalidCredentials
Invalid credentials (401).
DuplicateEmail
Email already taken (409).
DuplicateUsername
Username already taken (409).
WeakPassword(PasswordPolicyError)
The chosen password breaks the strength policy (400).
The message says which rule, so the user knows what to change.
ApiKeyNotFound(Uuid)
API key not found (404).
UserNotFound(Uuid)
User not found (404).
Forbidden
Insufficient permissions for this action (403).
SecretNotFound(String)
Secret not found (404).
InsufficientScope
Insufficient scope (403).
IdempotencyKeyConflict(Uuid)
The idempotency key is already bound to a different request (409).
Carries the run holding the key so the client can inspect it.
ConcurrencyConflict
A non-terminal run already holds the requested concurrency key (409).
Carries the key and the run holding it so the client can follow it.
MonthlyBudgetExceeded(String)
The global monthly cost quota is exhausted (429).
Only blocks the creation of new runs; runs already in flight continue.
ArtifactNotFound(String)
The requested artifact does not exist (404).
No artifact storage backend is configured (501).
Every other endpoint keeps working: an upgraded deployment that has not opted into artifacts is degraded here only.
ArtifactTooLarge
The uploaded payload exceeded the artifact size limit (413).
ScheduleNotFound(Uuid)
Schedule not found (404).
DelegationNotFound(Uuid)
Approval delegation not found (404).
ProviderAccountNotFound(String)
Provider Account not found (404), by id or name.
AccountCredentialRejected(String)
The account credential was rejected, by format or by the provider (422).
Store(StoreError)
Store operation failed (500).
Internal(String)
Internal server error (500).
BadGateway(String)
An upstream service is unreachable or returned an error (502).
RegistryNotFound
No template registry exists at the configured URL (404).
RegistryUnreachable
The template registry host cannot be reached (502).
InvalidInput(Vec<String>)
A submitted value does not match the expected JSON schema (422).
Carries one human-readable message per violation, returned to the
caller under details.errors.
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()