sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.32k stars 938 forks source link

fix: correct support for AbortSignal:timeout() #2388

Closed katsanva closed 3 weeks ago

katsanva commented 3 weeks ago

See #2371

This changes the rejected value to TimeotError when AbortSignal:timeout() is initially aborted.

As stated in docs:

The signal will abort with its AbortSignal.reason property set to a TimeoutError DOMException on timeout, or an AbortError DOMException if the operation was user-triggered.

Checklist

tal-rofe98 commented 1 week ago

@sindresorhus This should have been marked as breaking change..