Expand description
§Error Handling
Restate handles retries for failed invocations. By default, Restate does infinite retries with an exponential backoff strategy.
For failures for which you do not want retries, but instead want the invocation to end and the error message
to be propagated back to the caller, you can return a TerminalError
.
You can return a TerminalError
with an optional HTTP status code and a message anywhere in your handler, as follows:
Err(TerminalError::new("This is a terminal error").into())
You can catch terminal exceptions. For example, you can catch the terminal exception that comes out of a call to another service, and build your control flow around it.
Structs§
- Handler
Error - This error can contain either a
TerminalError
, or any other Rust’sStdError
. For the latter, the error is considered “retryable”, and the execution will be retried. - Terminal
Error - Error representing the result of an operation recorded in the journal.
Type Aliases§
- Handler
Result - Result type for a Restate handler.