Re: [fetch] Aborting a fetch (#27)

@jyasskin, I agree precisely regarding the error type. Using `instanceof` is perfectly good.

As for upstream cancellation, I'd like to expand on the virtues of the .NET `CancellationToken` design. While I'll concede that the need for a cooperative cancellation process in a multithreaded system is somewhat diminished in the JS context, the benefits for transparency here are quite significant. In fact, this is considered the primary benefit in the .NET design: https://msdn.microsoft.com/en-us/library/dd997364(v=vs.110).aspx

I'm also concerned that unless all promises are cancellable we well generate surprisingly non-uniform behaviour. Take:
```js
fetch().then(x).abort();
y().then(() => fetch()).then(x).abort();
```
That alone is surprising, since the second call fails. The actual results can be hard to predict if the call to `fetch()` is wrapped.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/27#issuecomment-87284542

Received on Saturday, 28 March 2015 19:01:50 UTC