Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Error handling #21

Open
notator opened this issue Dec 8, 2015 · 0 comments
Open

Error handling #21

notator opened this issue Dec 8, 2015 · 0 comments

Comments

@notator
Copy link
Owner

notator commented Dec 8, 2015

I think the host ought to enclose the call to synth.send(...) in a try..catch clause, since there's no way to guarantee that the synth isn't going to throw an exception. Maybe there's a programming error in there somewhere.

But I don't think software synths should throw exceptions deliberately. Its probably very time-consuming.

My versions of the synthesizer code now use console.warn(...) when the synth recieves a message that it can't deal with. If the synth warns the host while the host is being programmed, then the host can avoid sending unnecessary messages. This has worked fine for me.

Can the calls to console.warn be left in production code, or must there be two versions of the synth: one that warns, and one that just ignores unimplemented messages?

Is there a better way to do this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant