Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does console.error stops the code execution when fired?

Tags:

javascript

I am writing a program which loads a file and run some functions on it. Multiple files can be loaded.

If there's an error loading the file, like a misspelling of the name, I log a console.error. But I don't want to stop the execution.

Does console.error stops the execution? Does throw new error can be an alternative? Or should I use console.warn?

like image 865
Sanket Singh Avatar asked Sep 18 '25 09:09

Sanket Singh


1 Answers

Does console.error stops the execution?

No

Does throw new error can be an alternative?

Yes, as follow: throw new Error("Message");

like image 67
Ele Avatar answered Sep 20 '25 23:09

Ele