Closed jcelerier closed 8 months ago
having some good progress here with std::error_code which looks like the error reporting system that fits this library best : feature/error_code
Many functions that did fail silently now report errors back to the caller.
however there is an API break: https://en.cppreference.com/w/cpp/error/error_code/operator_bool
before, if(midi.open_port())
would return true if the port could be opened. But std::error_code uses true-y values to indicate that an error happened : the conditions have to be changed into if(midi.open_port() != std::error_code{})
also investigating https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1028r6.pdf through https://github.com/ned14/status-code ; it is a clear improvement
done in master - right now it uses stdx::error until we get C++26 and std::error
Title says it all, the exception-based error handling is terrible.