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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more