Errors thrown by the script itself can be easily handled, but those thrown within the context on Nightmare are a little bit harder. These come in 2 categories:
Errors thrown by the script being injected
Errors thrown by the page itself
This can probably be achieved by wrapping the injected code in a try block (which is already done but needs to be tested) and with the on action. Also see available events
Errors thrown by the script itself can be easily handled, but those thrown within the context on Nightmare are a little bit harder. These come in 2 categories:
This can probably be achieved by wrapping the injected code in a
try
block (which is already done but needs to be tested) and with theon
action. Also see available events