Is it possible to catch exceptions of renderer processes in electrons main process?
<p>I'm using <a href="https://github.com/electron/electron-quick-start" rel="noreferrer">Electrons Quick Start Projekt</a> (Commit dbef48ee7d072a38724ecfa57601e39d36e9714e) to test exceptions.</p>

<p>In <code>index.html</code> I changed the name of the required module from <code>renderer.js</code> to <code>rendererXXX.js</code>.</p>

<pre><code>require('./renderer.js')
</code></pre>

<p>which results in an expected Exeption (it is visible in the devtools for that window):</p>

<pre><code>Uncaught Error: Cannot find module './rendererXXX.js'
</code></pre>

<p>Now it would be nice if the main-process (see <code>main.js</code>) is aware that one renderer process failed. Thus I wrapped the instatiation of the window into a try-catch-block</p>

<pre><code>try {
  app.on('ready', createWindow)
} catch (e) {
  console.log("Exception caught: " + e.message);
} finally {
  // nothing yet
}
</code></pre>

<p>But I realized, that the Exception is <strong>not</strong> forwarded to the main-process. So what are typical ways to handle exceptions of renderer processes - is there a way to handle them from the main-process?</p>

<p>EDIT:</p>

<p>I also wrapped the line that loads the <code>index.html</code> into try-catch, but still I can't handle the error:</p>

<pre><code>  try {
    // and load the index.html of the app.
    mainWindow.loadURL(`file://${__dirname}/index.html`)
  } catch (e) {
    console.log("Exception caught in 'createWindow': " + e.message);
  }
</code></pre>