Comments (8)
fetch
by design only rejects if there is a network issue(being offline p.e). You need to check for response.ok
to know if the request was successful or not. That is how fetch works.
from ember-fetch.
So even if the site I'm connecting to is offline, it's still a successful promise?
I understand that it doesn't reject on status codes, but not rejecting on network errors is confusing. Thanks anyway!
from ember-fetch.
On network errors it should reject indeed. If it doesn't it's a bug, but this polyfill is so popular that I don't think that's possible. Are you talking about tests?
from ember-fetch.
I've got a fiddle here: https://ember-twiddle.com/625abf7d2eff52a579bf2d82c1eceadc?openFiles=controllers.application.js%2C
I get:
DNS pollyfill: false
DNS fetch: true
SSL pollyfill: false
SSL fetch: true
I am behind a proxy, but still, there seems to be a difference. Can you replicate this?
from ember-fetch.
Using [email protected]
results in true
for all 4 cases. It appears that this change (10ea9e1) may have introduced it.
from ember-fetch.
Actually I see the error now. I'll see if I can fix it tonight. Essentially we need to return a rejected promise from the second then so we propagate the rejection
from ember-fetch.
Damn. Yes, I need to rethrow. 🤦♂️
from ember-fetch.
@rwjblue / @cibernox just a headsup. Master will be a major version bump. So I have created a release-2 branch for all work destined for a 2x release (which this seems part of)
https://github.com/stefanpenner/ember-fetch/commits/release-2
from ember-fetch.
Related Issues (20)
- Strip out console.log for "This response was unable to be parsed as json" in production HOT 2
- Version 6.7.2 onwards seems not to transpile to es5 (Caused IE11 Blank screen, with no console errors) HOT 2
- Could not find module `fetch` imported from `prog/instance-initializers/setup-fetch` HOT 2
- Operation outputFileSync is not allowed to use HOT 15
- Where are all the response headers? HOT 2
- Inconsistent Headers objects with preferNative HOT 1
- fetch is not defined - maybe your browser targets are not covering everything you need HOT 31
- v8.0.3 contains `yarn-error.log` file
- Ember 3.27+ issues deprecation for accessing `window.Ember` HOT 1
- Could not find module `rsvp` imported from `fetch` HOT 6
- Version 8.1.0 not released to NPM? HOT 1
- Migration from jquery.ajax $.ajaxSettings.traditional = true. How remove [] from params
- Dropping Node 10, older versions of Ember
- Archive this repo? HOT 16
- Deprecation warning for assign() from ember/polyfills
- Failed to execute 'fetch' on 'Window': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.
- ember-polyfills.deprecate-assign deprication in Ember 4.4
- ember-fetch `input` type parameter is incorrect
- Upgrade package "node-fetch" to fix
- `Error: cannot find module rsvp imported from fetch`: Ember 4.12 + embroider-optimized scenario HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-fetch.