Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What could cause Electron to not show any errors?

I have taken over an Electron project from another developer.

The problem I am facing is that the project does not show any errors. Even including something like throw "this is an error" does not produce any output on the main process or render process consoles or any sort of standard error popup.

I have checked to confirm that electron-unhandled is not in use and that nothing registers 'uncaughtException'.

What am I missing that could cause this behavior?

like image 820
0x90 Avatar asked Jun 24 '20 04:06

0x90


2 Answers

Search for: unhandledRejection

  • unhandledRejection : This will catch any thrown errors, or non fatal errors you have successfully handled via throw.
  • uncaughtException : This only catches fatal errors or errors that would crash your node instance
  • WebWorkers : There will be yet another console for webworkers if your using those.
  • package.json : Take a look in here at the script executed to start electron or however your starting it... Make sure the console is not being sent to a remote console. This feature would allow for debugging the application via Chrome/Firefox vs the standard console. Pretty common for electron apps. If is done via the startup command.

May look something like this:

process.on('unhandledRejection', function (err) {
   
});

Also, make sure you include any modules in your searching for suppressors as the issue may exist somewhere in the node_modules directory and many IDE's (mine does by default) exclude that directory in indexing/searches.

like image 161
factorypolaris Avatar answered Oct 04 '22 21:10

factorypolaris


Another possible reason could be stdout and/or stderr redirection, the problem is this could be achieved by several ways so it's hard to suggest you what to check...

If there is some child_process call to launch a sub-process you could check the stdio array used, or you can check if some low level operation is performed against file descriptors 1 and 2...

Hope this helps.

like image 29
Daniele Ricci Avatar answered Oct 04 '22 23:10

Daniele Ricci