b15f/driver/drv/driverexception.h
2019-05-09 13:37:15 +02:00

34 lines
515 B
C++

#ifndef DRIVEREXCEPTION_H
#define DRIVEREXCEPTION_H
#include <exception>
// SOURCE: https://stackoverflow.com/a/8152888
class DriverException: public std::exception
{
public:
explicit DriverException(const char* message) : msg_(message)
{
}
explicit DriverException(const std::string& message) : msg_(message)
{
}
virtual ~DriverException() throw ()
{
}
virtual const char* what() const throw ()
{
return msg_.c_str();
}
protected:
std::string msg_;
};
#endif // DRIVEREXCEPTION_H