#ifndef HARDWAREEXCEPTION_H #define HARDWAREEXCEPTION_H #include #include "logger/ESeverityLevel.h" #include "model/hardware/exception/HwExceptionDef.h" class HardwareException : public std::exception { private: quint32 _errId; QString _innerMessage; public: explicit HardwareException(quint32 errId) { _errId = errId; } explicit HardwareException(quint32 errId, QString innerMessage) { _errId = errId; _innerMessage = innerMessage; } const char* what() const noexcept override { return HwErrors::getErrorMessage(_errId).toStdString().c_str(); } ESeverityLevel::eSeverityLevel getSeverityLevel() const { return HwErrors::getSeverityLevel(_errId); } quint32 errId() const { return _errId; } QString getInnerMessage() const { return _innerMessage; } QString getMessage() const { return HwErrors::getErrorMessage(_errId); } }; #endif //HARDWAREEXCEPTION_H