question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error.code missing on Network Error

See original GitHub issue

Is your feature request related to a problem? Please describe. To properly identify errors reliably, I’d like to be able to either compare an error with instanceof or alternatively with error.code. However, this does not exist on most of the errors. I noticed that when defining a timeout, I get at least a 'ECONNABORTED' code. Other errors like 404, 403 are also missing this code.

Describe the solution you’d like I’d have for 400/500 codes the error code of the name of the error, or at least the classification ClientError or ServerError.

Describe alternatives you’ve considered I can also compare the name, but now I need to compile a list of codes,names and whatnot to check whether or not I am connected.

So right now I have error.code == 'ECONNABORTED' || error.name == 'Network Error' It would be a lot easier to consume and work with this error if I could e.g. create an array of matching error codes and just check with includes.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jiangxiaoxincommented, Sep 4, 2019

Maybe it’s just a feature

H%)MG47NV6MV20Q%0Z1Z3_T

0reactions
jasonsaaymancommented, Oct 22, 2021

See #4209

Read more comments on GitHub >

github_iconTop Results From Across the Web

12 Methods To Fix Not Registered On Network Error On ...
Force Restart Device ; Update Your Phone To Latest OS; Choose Network Manually; Switch Off All Wireless Connection; Reinsert Battery And SIM Card ......
Read more >
Error codes in Device Manager in Windows - Microsoft Support
Lists the error codes that may be reported by Device Manager and the possible resolutions in Windows.
Read more >
How to Fix the “Not Registered on Network” Error on Android
How to Fix the “Not Registered on Network” Error on Android · Toggle On and Off the Airplane Mode · Restart Your Android...
Read more >
3. HTTP Status Codes and Errors - HttpWatch
If a network error occurs while transmitting a request message, error information is available from the underlying network component; e.g. Windows Sockets or ......
Read more >
[8 Tips] How to Fix “Not Registered on Network” Error on Android
How to Fix Not Registered on Network Error · Restart your Samsung/Android Phone · Manually Choose your Network · Disable All Network Connections....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found