How to deal with errors and write reliable tasks.
openai.chat.completions.create()
can throw an error.retry.onThrow
fail, an error will be thrown. You can catch this or
let it cause a retry of the entire task.fetch
, axios
, or any other library in your code.
But we do provide a convenient function to perform HTTP requests with conditional retrying based on the response:
retry.fetch
fail, an error will be thrown. You can catch this or let
it cause a retry of the entire task.handleError
callback on the task and in your trigger.config
file. This gets called when an uncaught error is thrown in your task.
You can
AbortTaskRunError
AbortTaskRunError
. This will fail the task attempt and disable retrying.