title: custom error window/handling in Electron
body: <p>I'm currently building an application for file backup, and it got quite a bit of reading and writing to the filesystem. Most of it works great, but I'm struggling a bit with the error handling of the app.</p>
  
  <p>In the screenshot below the last path is not a valid directory and return an exception as you can see. </p>
  
  <p><a href="https://i.stack.imgur.com/oBid4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oBid4.jpg" alt="enter image description here"></a></p>
  
  <pre><code>function getTotalSize(pathToDir, dir) {
  fs.readdir(pathToDir, function(err, files) {
      if (err) {
          // handle my error here
          throw new Error('something bad happened');
          return;
      }
  
      // continue if no errors :) 
  </code></pre>
  
  <p>My question is, is it possible to replace the standard error window with my own? Or in some cases ignore the pop up of the error window? First time working with Electron so sorry if this is an obvious one.</p>
  
  <p>Thanks!</p>