add exception

This commit is contained in:
2025-04-18 12:51:43 +03:00
parent 3f559432ba
commit e11b1d9f3c
3 changed files with 17 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <experimental/source_location>
#include <any>
#include "hack/utils/color.hpp"
#include "hack/exception/title.hpp"
@@ -22,6 +23,7 @@ namespace hack
void system_error(const std::exception& e) noexcept { m_system_error = e.what(); }
void title(const std::string v) noexcept { m_title = v; }
void description(const std::string v) noexcept { m_description = v; }
void set_data(std::any v) noexcept { m_data = v; }
void log()
{
@@ -52,5 +54,6 @@ namespace hack
std::string m_title { exception_title::NO_VALID_DATA };
std::string m_description;
std::experimental::source_location m_location;
std::any m_data;
};
}