martin-olivier / dylib

C++ cross-platform wrapper around dynamic loading of shared libraries (dll, so, dylib)
https://conan.io/center/recipes/dylib
MIT License
293 stars 44 forks source link

Let exceptions inherit standard exception classes with strings #31

Closed eyalroz closed 2 years ago

eyalroz commented 2 years ago

The exception class inherits directly from std::exception. But - your exceptions seem to be either runtime errors (file not found), or invalid arguments (e.g. passing a null extension) etc. So, inherit from the appropriate standard exception class. That would also remove the need for the base class with the string member - don't reinvent the wheel unless you have to.

eyalroz commented 2 years ago

Actually, consider #32 as well - it's not clear you even want custom exceptions at all.