Adding error reporting to CasperJS scripts