From 25a128d5b963044b5704120482f6bce590a45701 Mon Sep 17 00:00:00 2001 From: Try Date: Mon, 15 Dec 2025 20:41:38 +0100 Subject: [PATCH] report information about symbol name in exception --- include/zenkit/DaedalusVm.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zenkit/DaedalusVm.hh b/include/zenkit/DaedalusVm.hh index b4659d93..17a81eed 100644 --- a/include/zenkit/DaedalusVm.hh +++ b/include/zenkit/DaedalusVm.hh @@ -502,7 +502,7 @@ namespace zenkit { template void override_function(std::string_view name, std::function const& callback) { auto* sym = find_symbol_by_name(name); - if (sym == nullptr) throw DaedalusVmException {"symbol not found"}; + if (sym == nullptr) throw DaedalusSymbolNotFound {std::string {name}}; if (sym->is_external()) throw DaedalusVmException {"symbol is already an external"}; if constexpr (!std::same_as) { @@ -571,8 +571,8 @@ namespace zenkit { /// \param callback The C++ function to register as the external. void override_function(std::string_view name, std::function const& callback) { auto* sym = find_symbol_by_name(name); - if (sym == nullptr) throw DaedalusVmException {"symbol not found"}; - if (sym->is_external()) throw DaedalusVmException {"symbol is already an external"}; + if (sym == nullptr) throw DaedalusSymbolNotFound {std::string {name}}; + if (sym->is_external()) throw DaedalusVmException {"symbol " + sym->name() + " is already an external"}; _m_function_overrides[sym->address()] = [callback](DaedalusVm& machine) { callback(machine); }; }