You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using osc-js in a Node.js environment with the DatagramPlugin.
When a malformed UDP packet arrives, where the path doesn't start with a /, osc-js throws an error with the message OSC Message found malformed or missing address string. In my case this causes the application to exit with code 1, although I think, osc-js could recover from this error by ignoring this message. (For your reference: such a malformed packet is being produced by the JUCE OSC component, when the path is just a /. JUCE removes trailing slashes and creating an invalid OSC message).
What is the recommended way to handle errors that might occur during unpacking an OSC message (or any other recoverable error)? As a workaround I am using process.on('uncaughtException', (error) => {...}) to handle this, but this gets difficult to handle, since I wouldn't want to catch other unhandled exceptions, except the ones from osc-js.
Also, I think it would make sense to catch recoverable errors in osc-js and fire the 'error' event of osc-js instead of crashing the application.
The text was updated successfully, but these errors were encountered:
I agree: for art installations (or anything artistic or performative: that's where OSC is mostly used) this behaviour is worrysome. I would suggest the errors that are thrown now, should be emitted to the "error" event handlers: that is the behaviour I would expect (since it exists already).
Thank you for this report, it's indeed unfortunate that internal errors haven't been caught and reported correctly. I provided a test and fix here: #79
I am using osc-js in a Node.js environment with the DatagramPlugin.
When a malformed UDP packet arrives, where the path doesn't start with a
/
, osc-js throws an error with the messageOSC Message found malformed or missing address string
. In my case this causes the application to exit with code 1, although I think, osc-js could recover from this error by ignoring this message. (For your reference: such a malformed packet is being produced by the JUCE OSC component, when the path is just a/
. JUCE removes trailing slashes and creating an invalid OSC message).What is the recommended way to handle errors that might occur during unpacking an OSC message (or any other recoverable error)? As a workaround I am using
process.on('uncaughtException', (error) => {...})
to handle this, but this gets difficult to handle, since I wouldn't want to catch other unhandled exceptions, except the ones from osc-js.Also, I think it would make sense to catch recoverable errors in osc-js and fire the 'error' event of osc-js instead of crashing the application.
The text was updated successfully, but these errors were encountered: