What programming language returns a 500 error because it fails?
A 500 area is a critical server failure, It isn’t something that can happen because a piece of JavaScript failed.
Submitted 1 week ago by bluelion@sh.itjust.works to greentext@sh.itjust.works
What programming language returns a 500 error because it fails?
A 500 area is a critical server failure, It isn’t something that can happen because a piece of JavaScript failed.
Maybe PHP? Since it runs as a server and returns computed results in a browser… Though I’m pretty sure it’d just return the compiler error text
Php outputs HTML at the end of the process. If it didn’t run because of a missing semicolon it would just output an error. It wouldn’t crash
Any programming language that runs on the web server and doesn’t gracefully handle its errors. There are many web servers implemented in Javascript, but it could also be Java, it could be Perl, it could even be C/C++ if someone is being masochistic.
Couldn’t be a compiled language, those wouldn’t even get to the point where you send a request.
Javascript also exists on the server, and an exception would cause a 500 error. Semicolons are optional in JavaScript, except for a handful of cases. One of those is in a for loop. I’m guessing the professor was running a nodejs app and did something like this (intentionally bad style because professor):
for (x = 0; x < 5 x++) {} return x
Boom, syntax error, which would return a 500 air status in a nodejs web server framework.
Old IIS versions with PHP would do this when running in production mode. Talking about 2010-2012
IIS. That brought back bad memories.
Intro to IT on some webform stuff is truly the darkest timeline.
Where have the good old times gone when peeps were tortured with plain C in some atrocious outdated IDE from the ancient times?!
Ugh, I don’t want to touch codeblocks again
I do that too forotheer subjects
lime@feddit.nu 1 week ago
how tf would a missing semicolon result in a http server error
joyjoy@lemm.ee 1 week ago
File fails to compile, web server tries to run the file, error.
sugar_in_your_tea@sh.itjust.works 5 days ago
Nodejs exists. Here’s a JS snippet that would throw an exception:
echodot@feddit.uk 6 days ago
If the file failed to compile the server wouldn’t execute it because a file wouldn’t be created. A compile error stops the process, It doesn’t result in a corrupted output, since that would be really stupid.
lime@feddit.nu 6 days ago
if your server runs user-submitted code server side, that’s a paddlin
merc@sh.itjust.works 6 days ago
If the web server is implemented in any of the languages that require semicolons.
lime@feddit.nu 6 days ago
why would you demo a for loop with a web server