Exceptions or Error Return Codes?

In the initial version of my WinReg C++ library, I made a design decision that methods that wrapped Win32 Registry C API calls would throw C++ exceptions on errors.

Important feedback I got from the users of this library was that they wanted methods that returned error codes instead of throwing exceptions (e.g., see this issue).

For example, when opening a registry key, folks want to be able to check the result of the operation without having exceptions thrown from failed opens. Similarly when trying to read values from the registry.

This is a good remainder for those C++ devs who think that we should always throw exceptions instead of using error return codes!