PorygonLang/src/Exception.hpp

21 lines
392 B
C++

#ifndef PORYGONLANG_EXCEPTION_HPP
#define PORYGONLANG_EXCEPTION_HPP
#include <exception>
#include <utility>
class Exception : public std::exception{
const std::string _err;
public:
explicit Exception(const char* err) :_err(std::string(err)){ }
[[nodiscard]] const char *what() const noexcept final {
return _err.c_str();
}
};
#endif //PORYGONLANG_EXCEPTION_HPP