Skip to content

File AError.hpp

File List > Engine > include > Errors > AError.hpp

Go to the documentation of this file

#ifndef ENGINE_ERRORS_AERROR_HPP_
#define ENGINE_ERRORS_AERROR_HPP_

#include "Errors/IError.hpp"
#include <string>

namespace Engine {

class AError : public IError {
  public:
    AError(const std::string& typePrefix, const std::string& detail, error_severity_e severity)
        : m_Message(typePrefix + detail), m_Severity(severity) {}

    const char* what() const noexcept override { return m_Message.c_str(); }

    error_severity_e GetSeverity() const noexcept override { return m_Severity; }

  protected:
    std::string m_Message;
    error_severity_e m_Severity;
};

} // namespace Engine

#endif // ENGINE_ERRORS_AERROR_HPP_