The question is:
I'm currently working on Node.js with the Puppeteer library and I need to print "SUCCESS" to the console after a successful run and "ERROR" after a failed run. But I don't quite understand how to do it.
I will be grateful to everyone for help.
You could wrap the whole thing in a try...catch
try {
// Your Code Here
console.log('Success');
} catch (event) {
console.error('Error');
}