Catch and Handle CasperError

Viewed 5855

Using CasperJS how do I catch and handle CasperError?

The default appears to continue execution of the program (which does nothing but propagates the error).

These errors are logged to the console/stdout but I don't seem to see a way (from the docs) to catch and handle these errors.

Example:

this.fillSelectors(selector, data);

May produce:

CasperError: Errors encountered while filling form: form not found

I know I can check to make sure everything exists before calling, but is there a way to catch after the fact? (this applies to many other operations like casper.click as well)

3 Answers
Related