#ifndef EXCEPTIONS_H_AQKXZ8P3
#define EXCEPTIONS_H_AQKXZ8P3
#include <QException>
namespace interpreter {
class Exceptions : public QException
{
public:
virtual QException *clone() const override
{
return new Exceptions(*this);
}
virtual void raise() const override
{
throw *this;
}
};
class UnexpectedMessage : public Exceptions
{
protected:
std::string m_details;
public:
UnexpectedMessage(QString details)<--- Class 'UnexpectedMessage' has a constructor with 1 argument that is not explicit. [+]Class 'UnexpectedMessage' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
: Exceptions()
, m_details(details.toStdString())
{
}
UnexpectedMessage(const UnexpectedMessage &other)
: Exceptions(other)
, m_details(other.m_details)
{
}
virtual const char *what() const noexcept
{
return m_details.c_str();
}
virtual QException *clone() const override
{
return new UnexpectedMessage(*this);
}
virtual void raise() const override
{
throw *this;
}
};
}
#endif /* end of include guard: EXCEPTIONS_H_AQKXZ8P3 */