trigger.dev
trigger.dev copied to clipboard
[TRI-2048] Better handle `fetch` throwing errors in our ApiClient
As you can see in the code below, we aren't handling any thrown errors by fetch:
https://github.com/triggerdotdev/trigger.dev/blob/5d78bba5e3fda2668bbd1d3d67f8ba4c4479c559/packages/trigger-sdk/src/apiClient.ts#L888
This can lead to issues when the fetch times out and throws an error. We should fix this and also investigate which other errors can be thrown and handle those with retries (if it makes sense).