title: CasperJs onError not working
body: <pre><code>var casper = require('casper').create({
      //verbose: true,
      logLevel: "debug",
      waitTimeout: 20000,
      onError: function(self, m) {
          console.log('FATAL');
          self.exit();
      }
  });
  </code></pre>
  
  <p>When I execute my code in the command line it will print a CasperError. For example:</p>
  
  <p>CasperError: Cannot dispatch mousedown event on nonexistent selector: #selector;
  or
  CasperError: No element matching selector found: #selector</p>
  
  <p>I would expect it to instead be outputting the text 'FATAL'. I've tried casper.Echo() instead of console.log() and the message is still not displayed.</p>
  
  <p>I have also set: </p>
  
  <pre><code>casper.on('remote.message', function(message) {
       this.echo(message);
  });
  </code></pre>
  
  <p>And elsewhere in the script console.log() will output text tothe command line.</p>
  
  <p>So it would appear to me that this onError function is not being called at all. Any idea why this might be?</p>