pub enum CanoError {
NodeExecution(String),
TaskExecution(String),
Preparation(String),
Store(String),
Workflow(String),
Configuration(String),
RetryExhausted(String),
Generic(String),
}Expand description
Comprehensive error type for Cano workflows
This enum covers all the different ways things can go wrong in Cano workflows. Each variant is designed to give you clear information about what happened and how to fix it.
§🎯 Error Categories
§NodeExecution
Something went wrong in your node’s business logic during the exec phase.
Common causes:
- Invalid input data
- External API failures
- Business rule violations
- Resource unavailability
How to fix: Check your node’s exec method logic and input validation.
§Preparation
Something went wrong while preparing data in the prep phase.
Common causes:
- Missing data in store
- Invalid data format
- Resource initialization failures
How to fix: Verify that previous nodes stored the expected data.
§store
store operations failed (get, put, remove, etc.).
Common causes:
- Type mismatches when retrieving data
- store backend issues
- Concurrent access problems
How to fix: Check store keys and ensure type consistency.
§Workflow
Workflow orchestration problems.
Common causes:
- Unregistered node references
- Invalid action routing
- Circular dependencies
How to fix: Verify node registration and action string routing.
§Configuration
Invalid node or workflow configuration.
Common causes:
- Invalid concurrency settings
- Negative retry counts
- Conflicting settings
How to fix: Review node builder parameters and workflow setup.
§RetryExhausted
All retry attempts have been exhausted.
Common causes:
- Persistent external failures
- Insufficient retry configuration
- Systemic issues
How to fix: Increase retry count, fix root cause, or add exponential backoff.
§💡 Usage Examples
Create specific error types with helpful messages. Use the appropriate error variant (NodeExecution, Configuration, store, etc.) and provide clear, actionable error messages that help users understand what went wrong.
§🔄 Converting from Other Errors
Cano errors can be created from various sources including standard library
errors, string slices, and owned strings. Use the appropriate constructor
method or the Into trait for convenient conversion.
Variants§
NodeExecution(String)
Error during node execution phase (your business logic)
Use this when your node’s exec method encounters an error in its
core processing logic. Include specific details about what went wrong.
TaskExecution(String)
Error during task execution
Use this when your task’s run method encounters an error during
execution. This is the task-specific equivalent of NodeExecution.
Preparation(String)
Error during node preparation phase (data loading/setup)
Use this when your node’s prep method fails to load or prepare data.
Often indicates missing or invalid data in store.
Store(String)
Error in store operations (get/put/remove)
Use this for store-related failures like missing keys, type mismatches, or store backend issues.
Workflow(String)
Error in workflow orchestration (routing/registration)
Use this for workflow-level problems like unregistered nodes, invalid action routing, or workflow configuration issues.
Configuration(String)
Error in node or workflow configuration (invalid settings)
Use this for configuration problems like invalid parameters, conflicting settings, or constraint violations.
RetryExhausted(String)
All retry attempts have been exhausted
This error is automatically generated when a node fails and all configured retry attempts have been used up.
Generic(String)
General-purpose error for other scenarios
Use this for errors that don’t fit the other categories. Try to be specific in the error message.
Implementations§
Source§impl CanoError
impl CanoError
Sourcepub fn node_execution<S: Into<String>>(msg: S) -> Self
pub fn node_execution<S: Into<String>>(msg: S) -> Self
Create a new node execution error
Sourcepub fn task_execution<S: Into<String>>(msg: S) -> Self
pub fn task_execution<S: Into<String>>(msg: S) -> Self
Create a new task execution error
Sourcepub fn preparation<S: Into<String>>(msg: S) -> Self
pub fn preparation<S: Into<String>>(msg: S) -> Self
Create a new preparation error
Sourcepub fn configuration<S: Into<String>>(msg: S) -> Self
pub fn configuration<S: Into<String>>(msg: S) -> Self
Create a new configuration error
Sourcepub fn retry_exhausted<S: Into<String>>(msg: S) -> Self
pub fn retry_exhausted<S: Into<String>>(msg: S) -> Self
Create a new retry exhausted error
Sourcepub fn from_store_error(err: StoreError) -> Self
pub fn from_store_error(err: StoreError) -> Self
Convert a StoreError to a CanoError
This is a convenience method that explicitly converts store errors
to workflow errors. The automatic From implementation also works.