You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2025. It is now read-only.
Hi, I can't handle fetch cancelation. See code below:
Steps to reproduce
constfetchTask=(url)=>task(resolver=>{constcontroller=newAbortController()constinit={signal: controller.signal,method: 'post',}fetch(url,init).then(resolver.resolve).catch(resolver.reject)resolver.onCancelled(()=>{controller.abort()})})fetchTask('/some/path').run().cancel()// after cancel() i'll got this error:// Uncaught (in promise) Error: Only pending deferreds can be rejected, this deferred is already rejected.
Expected behaviour
Task rejected with error
I understand why does it happen but how I can handle cancelation error? Or may be I do it wrong?