oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.18k stars 2.68k forks source link

different error codes between Node and Bun in axios #11345

Open touhidurrr opened 3 months ago

touhidurrr commented 3 months ago

What version of Bun is running?

1.1.15-canary.1+3ff29955a

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

Run in powershell:

git clone -b status https://github.com/touhidurrr/bd-ftp-checker.git
cd bd-ftp-checker

try bun index.js and node index.js.

What is the expected behavior?

In Node:

  ____  ____    _____ _____ ____     ____ _               _
 | __ )|  _ \  |  ___|_   _|  _ \   / ___| |__   ___  ___| | _____ _ __
 |  _ \| | | | | |_    | | | |_) | | |   | '_ \ / _ \/ __| |/ / _ \ '__|
 | |_) | |_| | |  _|   | | |  __/  | |___| | | |  __/ (__|   <  __/ |
 |____/|____/  |_|     |_| |_|      \____|_| |_|\___|\___|_|\_\___|_|

- M. H. Nahib

❌ : http://old.circleftp.net ENOTFOUND
❌ : http://dflix.discoveryftp.net ENOTFOUND
❌ : http://cds1.discoveryftp.net ENOTFOUND
❌ : http://cds2.discoveryftp.net ENOTFOUND
❌ : http://cds3.discoveryftp.net ENOTFOUND
❌ : http://play.ebox.live ENOTFOUND

What do you see instead?

In Bun:

  ____  ____    _____ _____ ____     ____ _               _
 | __ )|  _ \  |  ___|_   _|  _ \   / ___| |__   ___  ___| | _____ _ __
 |  _ \| | | | | |_    | | | |_) | | |   | '_ \ / _ \/ __| |/ / _ \ '__|
 | |_) | |_| | |  _|   | | |  __/  | |___| | | |  __/ (__|   <  __/ |
 |____/|____/  |_|     |_| |_|      \____|_| |_|\___|\___|_|\_\___|_|

- M. H. Nahib

✅ : http://media.ftpbd.net 200
✅ : http://abistation.net/ 200
✅ : http://server1.ftpbd.net 200
✅ : https://www.discoverynetbd.com 200
❌ : http://ctgmovies.com 403
❌ : http://www.ddnbd.fun 403
❌ : http://crazyctg.com 403
✅ : https://uniquenetbd.com 200
✅ : https://www.mazedanetworks.net 200
❌ : http://dflix.discoveryftp.net ConnectionRefused
❌ : http://old.circleftp.net ConnectionRefused
✅ : https://icctalk.com 200
❌ : http://cds1.discoveryftp.net ConnectionRefused
✅ : https://fiber.colbd.com 200
❌ : http://cds3.discoveryftp.net ConnectionRefused
❌ : http://cds2.discoveryftp.net ConnectionRefused

Additional information

[!NOTE] Even if connection is refused, pretty sure the error code should be ECONNREFUSED instead of ConnectionRefused. Not sure why this is happening. Ok, ECONNREFUSED is a node specific error, maybe the error names are changed in Bun? Also notice how http://old.circleftp.net is ENOTFOUND in Node but ConnectionRefused in bun. ENOTFOUND should be when a domain does not exist. Why are we getting ConnectionRefused then?

touhidurrr commented 3 months ago

Still facing this issue in 1.1.15-canary.1+3ff29955a