Open xouillet opened 4 months ago
Hello ! Are you using an official release or the latest master ? Exception handling changed in current master (and has pretty much been removed) - now the handling is done through error propagation with https://github.com/charles-salvia/std_error to enable the library to work in more environments (a future goal is having it work on OS-less embedded platforms and that's a preliminary step).
What's missing is certainly [[nodiscard]] annotations and a documentation update to indicate to the user that the error has to be handled - but over 10-ish years of working with this, the exception handling of the library has caused me much more problems than it solved.
Hi,
Thanks for your response.
Yes, I'm using the current master. I now understand the external std::error implementation. I will now assume that the correct way to check a return code is the one I provided, for some reason the boolean cast of a stdx::error
doesn't work so we have to check using a comparison to stdx:error()
...
A documentation update would be nice indeed :)
Thanks
Hi,
I'm trying to understand how error handling is supposed to work for a basic function such as
midi.open_port
. Documentation is quite evasive and say that exception should be raised, but it doesn't.For example the following code:
No exception is thrown if
inputs[1]
doesn't exists.Throws an exception every time, even if the open succeed.
For now, I'm using (hacky ?)
I don't know if it's the right way to do it, if so it would be nice to have it documented.
Thanks