title: Johnny-Five - How to catch exceptions and prevent Node program to crash?
body: <p>I have a simple NodeJS program that uses <code>johnny-five</code> package to connect on 3 boards.</p>
  <pre><code>Object.keys(arduinosByKey).forEach(key =&gt; {
    const arduino = arduinosByKey[key]
    const board = new five.Board({
      port: new etherPort(arduino.port)
    })
    board.on('ready', () =&gt; {
      // Do something...
    })
    board.on('close', e =&gt; {
      // ...
    })
    board.on('exit', e =&gt; {
      // ...
    })
    board.on('fail', e =&gt; {
      // ...
    })
    // How to catch timeouts here? None of above catches.
  })
  </code></pre>
  <p>The problem is that when one board fails (e.g. timeouts), the whole NodeJS program is stopped:</p>
  <pre><code>Device or Firmware Error A timeout occurred while connecting to the Board.
  </code></pre>
  <p>How to catch board exceptions?</p>