complexdatacollective / Server

A tool for storing, analyzing, and exporting Network Canvas interview data.
http://networkcanvas.com/
GNU General Public License v3.0
2 stars 2 forks source link

better handling for mdns errors #323

Closed rebeccamadsen closed 3 years ago

rebeccamadsen commented 3 years ago

This adds a try/catch to help catch errors when Bonjour is not running.

For the unhandled rejection, I debated whether to push the error dialog out to the frontend, but kept it in the backend in case the frontend was part of the unexpected problem. I'm open to suggestions though if there's a preferred way to do this.

The try/catch will prevent the app from exiting even if Bonjour isn't running; I verified Interviewer can still pair. To test the error dialog, you would need to insert code to throw an artificial error, or comment out the try/catch in Server.js while Bonjour is stopped if you want to recreate the inspiration for this fix.

bonjour error

Note that in development mode, I did not see the same error as in production. The check for mdnsIsSupported works as hoped during development mode, but is more generous during production.

rebeccamadsen commented 3 years ago

error message