add try catch

This commit is contained in:
2025-06-09 14:58:51 +03:00
parent 0215e46e4f
commit 27c2e00faa

View File

@@ -3,6 +3,8 @@
#include <any> #include <any>
#include <string> #include <string>
#include <hack/security/uuid.hpp> #include <hack/security/uuid.hpp>
#include <hack/exception/exception.hpp>
#include <hack/logger/logger.hpp>
namespace VE namespace VE
{ {
@@ -21,7 +23,17 @@ namespace VE
template<typename T> template<typename T>
T get_result() T get_result()
{ {
auto r = std::any_cast<T>(m_result); T r;
try { r = std::any_cast<T>(m_result); }
catch(std::exception& e)
{
hack::exception ex;
ex.service(e.what());
ex.description("dont convert type any_cast");
ex.log();
throw ex;
}
return r; return r;
} }
}; };