pub enum ApiError {
Show 21 variants
RunNotFound(Uuid),
StepNotFound(Uuid),
WorkflowNotFound(String),
BadRequest(String),
Conflict(String),
Unauthorized,
InvalidCredentials,
DuplicateEmail,
DuplicateUsername,
ApiKeyNotFound(Uuid),
UserNotFound(Uuid),
Forbidden,
SecretNotFound(String),
InsufficientScope,
IdempotencyKeyConflict(Uuid),
MonthlyBudgetExceeded(String),
ArtifactNotFound(String),
ArtifactStorageUnavailable,
ArtifactTooLarge,
Store(StoreError),
Internal(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).
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.
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).
Store(StoreError)
Store operation failed (500).
Internal(String)
Internal server error (500).
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()
Source§impl From<StoreError> for ApiError
impl From<StoreError> for ApiError
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for ApiError
impl !UnwindSafe for ApiError
impl Freeze for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.