b15f/control/src/drv/driverexception.h

34 lines
515 B
C
Raw Normal View History

2019-03-26 10:35:20 +00:00
#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_;
};
2019-03-29 10:12:31 +00:00
#endif // DRIVEREXCEPTION_H
2019-05-09 11:37:15 +00:00