❗ Rust Errors
Common problems
Error is not the same Error type as the function return type
- Define a GenericResult:
type GenericError = Box<dyn std::error::Error + Send + Sync + 'static>;
type GenericResult<T> = Result<T, GenericError>;
- Use
GenericResult
as a result type - Use
anyhow
crate (preferred)