Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a method to reset the ok flag and clear the error message #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stfufane
Copy link

Hi,

I don't know if you might be interested or not by this pull request, but I'm making a wrapper around the library with Deno, something similar to what was made here for Node JS : https://github.com/justinlatimer/node-midi

And while trying to handle errors, I noticed two things :

  • The msg member of the device struct was set from a reference to an exception, and was then incorrect when the exception got out of scope (dangling pointer)
  • Once an error was met, the ok flag was set to false forever

It's kinda specific to that type of usage though, because I call the library with FFI bindings and then read the methods' results, so it's probably not required for a "classic" usage linking to a native C/C++ application.

Anyway, I'm open to your opinion on that :)

Cheers

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

Successfully merging this pull request may close these issues.

1 participant