Type for specifying failure handling behavior.
Can be either:
'error' or 'continue')
'error': Re-raise the exception, stopping agent execution.'continue': Inject a message with the error details, allowing the agent to continue.
For tool retries, a ToolMessage with the error details will be injected.
For model retries, an AIMessage with the error details will be returned.OnFailure = Literal['error', 'continue'] | Callable[[Exception], str]