NordicSemiconductor / pc-nrfconnect-shared

Dependency management for nRF Connect for Desktop packages
Other
22 stars 8 forks source link

Fix: Unhandled error on some `nrfutil` invocations #867

Closed datenreisender closed 10 months ago

datenreisender commented 10 months ago

When spawning the nrfutil process fails in certain ways, an uncaught exception in the main process got thrown.

The “certain ways” make this a bit hard to reproduce: On macOS this happened, when the nrfutil executable did not have the executable file mode. Usually this should not happen, because we set that mode ourselves correctly.

But when it happened (and there are probably more ways that can lead to this) a really ugly native dialog message was shown, because it was not reported back to the launcher as an error. The dialog looked e.g. like this:

image

The second change gives the launcher the ability to remove the launcher window from being used in IPC calls. This is especially needed on shutdown. Otherwise when at that time someone still tries to send IPC messages to the launcher window, an exception is thrown, resulting in a similarly ugly dialog.