-
Notifications
You must be signed in to change notification settings - Fork 347
error link does not give a real error object, thus no networkError.statusCode access possible #218
Comments
+1 the way I'm solving this temporarily is by picking up the status directly on the component that makes the call componentWillReceiveProps(nextProps) { ex: |
Yes, the |
This is kind of a big deal, I haven't found a solution for angular |
@miracle2k we are working to improve errors with #244, does it look like it will fix your issue? |
@jbaxleyiii Not sure, but a quick scan of the patch set doesn't lead me to conclude that it changes the object that Specifically, I want the status code so I can handle "403 Not Authorized" responses from the server and redirect to a login screen. This seems impossible right now. |
@miracle2k Looks like they added test coverage around 401 (which is what I think you mean) so hopefully that means the things they changed actually produce a result containing the status code. I would like to point out, however, that your webpackbin demonstrates (for me at least) that |
The problem and the solution (I guess)
from
Error in "networkError?: Error" should be like HttpErrorResponse from Angular A workaroundWith Angular
Without AngularCreate the type HttpErrorResponse like the one from Angular or change it for 'any'
|
This should be fixed in the newest release thanks to @evans work! |
seems it hasn't fixed. |
Same here. I updated the webpackbin above with the latest releases to show that the statusCode is still not accessible. |
yes, please waiting the fix, I've upgraded but have this problem in the real production environment.. |
Also having this issue. |
Likewise. @jbaxleyiii It doesn't look like the latest npm releases have this in. |
apollo looks a project abandoned, i'm migrating to manual fetch with javscript |
@webmobiles I'm sorry you feel this way! I hope that we can work together to fix this now Let's move the conversation to the open issue #300 |
I am basically using this example from the docs ("Afterware"): https://www.apollographql.com/docs/react/basics/network-layer.html
This doesn't work for me. "networkError" seems to be raised as a string, and only tells me "Failed to fetch". It doesn't have a stack, nor the .statusCode property.
https://www.webpackbin.com/bins/-KyLJ0NyjpkxU0ggok70
The text was updated successfully, but these errors were encountered: