Axios is it slower to auto catch error responses such as 404

0 votes
Just out of curiosity, the default setting for the axios package in javascript, node, or any other language is to throw an error for any response 400 or larger (I'm not sure if that's precisely correct, but meh). I've learned in the past that it's generally bad practise to use catch when an if statement would have sufficed. In order to answer my issue, would it be preferable to use an if statement rather than a catch in situations where 404 errors are anticipated to occur frequently (for the package axios, this entails changing the default settings for validateStatus)?

Things to think about: Does using AWS Lambda make a difference? Is it different for various JavaScript/browser/Node versions?

I would appreciate any advice:
Feb 14 in AWS by Ashwini
• 3,750 points

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

+2 votes
3 answers

Is it possible to ping AWS EC2 instance

1.Go to EC2 Dashboard and click "Running ...READ MORE

answered Nov 13, 2020 in AWS by shivam
• 140 points

edited Nov 13, 2020 by Gitika 17,269 views
0 votes
1 answer

Is it possible to stop nodes in AWS ElastiCache cluster

At this time there is not a ...READ MORE

answered Jun 21, 2018 in AWS by Flying geek
• 3,280 points
0 votes
1 answer

Nodejs Instagram videos downloader not working

Firstly, Initialize a package.json file with default values. npm ...READ MORE

answered Jun 9, 2022 in Node-js by Neha
• 8,940 points
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP