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.