简体   繁体   中英

Does console.error stops the code execution when fired?

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 ?

Does console.error stops the execution?

No

Does throw new error can be an alternative?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM