diff options
Diffstat (limited to 'zencore/except.cpp')
| -rw-r--r-- | zencore/except.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zencore/except.cpp b/zencore/except.cpp index 882f69f9a..124b9455f 100644 --- a/zencore/except.cpp +++ b/zencore/except.cpp @@ -2,6 +2,7 @@ #include <zencore/except.h> #include <system_error> +#include <fmt/format.h> namespace zen { @@ -24,4 +25,11 @@ ThrowLastError(std::string_view Message) throw std::system_error(std::error_code(::GetLastError(), std::system_category()), std::string(Message)); } +void +ThrowLastError(std::string_view Message, const std::source_location& Location) +{ + using namespace fmt::literals; + throw std::system_error(std::error_code(::GetLastError(), std::system_category()), "{}({}): {}"_format(Location.file_name(), Location.line(), Message)); +} + } // namespace zen |