Closed McSinyx closed 4 years ago
Makes sense. Some may actually be better as std::invalid_argument
, but for now I've changed the non-view-type std::out_of_range
exceptions to std::domain_error
, with commit 195e9347f0038bca9c27c2eeb7275efc1a2cdcf6.
I assume that backward compatibility might not be a major problem since you haven't made any official release of the new C++11 API.
Currently, Alure 2 makes no real promise to API/ABI compatibility. It will try to avoid any unnecessary or excessive changes, but given the C++ API and evolving functionality, it's not something that can be guaranteed.
Thank you for the quick response! I agree that for some cases, the exception might not exactly fall under std::domain_error
and the more general std::invalid_argument
might be a better choice, but I'm happy with the current state.
From cppreference.com,
std::out_of_range
Pitch and gain, for example, are floating points values, and thus IMHO should not throw this exception. I'd suggest
std::domain_error
which is defined asHere is the list of the current throws of
std::out_of_range
:I believe other than the ones thrown by type views, all should be substituted by a more proper exception.
Disclaimer: the reason I'm filing this issue is that Cython translate
std::out_of_range
asIndexError
whilestd::domain_error
is mapped toValueError
, which is more appropriate in Python context. I am not aware of the current usage of Alure 2 but I assume that backward compatibility might not be a major problem since you haven't made any official release of the new C++11 API.