pub trait TerminalErrorExt<T, E> {
// Required method
fn terminal(self) -> Result<T, HandlerError>;
}Expand description
Extension trait for converting any Result error into a TerminalError.
This trait provides a convenient way to convert errors from fallible operations into terminal errors that will not be retried by Restate.
§Example
use restate_sdk::prelude::*;
async fn handle() -> Result<(), HandlerError> {
let parsed: i32 = "not a number".parse().terminal()?;
Ok(())
}Required Methods§
Sourcefn terminal(self) -> Result<T, HandlerError>
fn terminal(self) -> Result<T, HandlerError>
Convert the error into a TerminalError with the default status code (500).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".