Closed sonoro1234 closed 2 years ago
There is definitely room for improvement in “error” reporting and I repeat that I think the changes made in the noexceptions branch are an improvement. But with regard to this specific case, the problem happens inside the getDeviceInfo() function. If there is a problem initializing the ASIO driver, I don’t see the point of throwing an exception. Instead, the function should return an empty info structure indicating no device available. Then the user can perhaps query a different API to try to find a working device.
On Mar 24, 2021, at 7:36 AM, Victor Bombi @.**@.>> wrote:
https://github.com/thestk/rtaudio/blob/master/RtAudio.cpp#L2900
sets the error type to WARNING and then https://github.com/thestk/rtaudio/blob/master/RtAudio.cpp#L10265 (and errorCallback is not set in C)
So that an error is printed and nothing else happens. (Althought it is a severe error: device not present)
I would be necessary for C interface making WARNING error to throw (may be a variable throwWarnings similar to showWarnings)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/thestk/rtaudio/issues/285, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJYDJJ4SCDZWDMUYA6UHVLTFHFCFANCNFSM4ZXCKVVQ.
Instead, the function should return an empty info structure indicating no device available.
checking info.probed != 0
is enough for me.
Stale issue and not sure it is still relevant given all the changes since it was posted.
https://github.com/thestk/rtaudio/blob/master/RtAudio.cpp#L2900
sets the error type to
WARNING
and then https://github.com/thestk/rtaudio/blob/master/RtAudio.cpp#L10265 (and errorCallback is not set in C)So that an error is printed and nothing else happens. (Althought it is a severe error: device not present)
I would be necessary for C interface making
WARNING
errors to throw (may be a variable throwWarnings similar to showWarnings)A workaround for this case is testing info.probed being true.