Category: Forms and APIs

fetch: AbortError after exceeding external API time

Read this guide in Polish

The request ends with AbortError or TimeoutError, although the endpoint responds after a while. AbortController's interruption and actual network failure are different situations requiring a different reaction.

How to determine the source of the error

Check configured timeout and API response time in both pages.

Verify that the cancellation controller is not shared between independent requests.

What to do step by step

1. Customize the time limit to the nature of the operation and handle the timeout and HTTP error separately.

2 . For long operations, use queue and status query instead of keeping your request open.

How to check the score

Overshooting the limit returns a friendly message and short operations are performed without racing.

What to do

Do not interpret the cancelled request as proof that the server side operation has not been performed.