pub enum ComponentError {
NotSupported(String),
ExecutionFailed(String),
InvalidPayload(String),
Aborted,
InitFailed(String),
Suspended {
approval_id: String,
grant_pattern: String,
pending_request: Value,
},
}Expand description
Component layer error.
§Variants
| Variant | When | Recovery |
|---|---|---|
NotSupported | Unknown operation | Fix request |
ExecutionFailed | Operation failed | May retry |
InvalidPayload | Bad request data | Fix payload |
Aborted | Signal-triggered abort | Intentional |
Suspended | Awaiting approval | Approval flow |
§Example
use orcs_component::ComponentError;
use orcs_types::ErrorCode;
fn handle_error(err: ComponentError) {
eprintln!("[{}] {}", err.code(), err);
if err.is_recoverable() {
eprintln!("May retry");
}
}Variants§
NotSupported(String)
Operation not supported by this component.
The requested operation is not recognized. Check the component’s supported operations.
Not recoverable - the operation will never work.
ExecutionFailed(String)
Execution failed during operation.
The operation was recognized but failed during execution. Common causes: timeout, resource unavailable, external service failure.
Recoverable - retry may succeed.
InvalidPayload(String)
Invalid payload in request.
The request payload doesn’t match expected format. Check payload structure and required fields.
Not recoverable - fix the payload.
Aborted
Component was aborted.
The component received an abort signal (Veto/Cancel). This is intentional termination, not an error condition.
Not recoverable - intentional stop.
InitFailed(String)
Initialization failed.
The component failed to initialize. Check configuration and dependencies.
Recoverable - may succeed with different config.
Suspended
Execution suspended pending human approval.
Returned by on_request() when a command requires permission
that hasn’t been granted yet. The ChannelRunner intercepts this
error and transitions to AwaitingApproval state, allowing the
event loop to continue processing signals (Approve/Reject).
On approval, the ChannelRunner grants the pattern and re-dispatches the pending request. On rejection, the request is discarded.
Recoverable - approval resolves this.
§Fields
approval_id: Unique ID for this approval request (matches Signal routing).grant_pattern: Permission pattern to grant on approval (e.g."shell:*").pending_request: Serialized original request for re-dispatch after approval.
Trait Implementations§
Source§impl Clone for ComponentError
impl Clone for ComponentError
Source§fn clone(&self) -> ComponentError
fn clone(&self) -> ComponentError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComponentError
impl Debug for ComponentError
Source§impl<'de> Deserialize<'de> for ComponentError
impl<'de> Deserialize<'de> for ComponentError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComponentError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComponentError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for ComponentError
impl Display for ComponentError
Source§impl Error for ComponentError
impl Error for ComponentError
1.30.0 · 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 ErrorCode for ComponentError
impl ErrorCode for ComponentError
Source§impl From<LuaError> for ComponentError
impl From<LuaError> for ComponentError
Source§fn from(err: LuaError) -> ComponentError
fn from(err: LuaError) -> ComponentError
Source§impl Serialize for ComponentError
impl Serialize for ComponentError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ComponentError
impl RefUnwindSafe for ComponentError
impl Send for ComponentError
impl Sync for ComponentError
impl Unpin for ComponentError
impl UnsafeUnpin for ComponentError
impl UnwindSafe for ComponentError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
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.