Skip to content

Commit

Permalink
feat: improve error message on hook failure
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Sep 11, 2024
1 parent 3c21f90 commit 516b705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/endstone_runtime/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ void install()
funchook_t *hook = funchook_create();
int status = funchook_prepare(hook, &original, detour);
if (status != 0) {
throw std::system_error(status, hook_error_category());
throw std::system_error(status, hook_error_category(), fmt::format("Unable to hook {}", name));
}

status = funchook_install(hook, 0);
if (status != 0) {
throw std::system_error(status, hook_error_category());
throw std::system_error(status, hook_error_category(), fmt::format("Unable to hook {}", name));
}

spdlog::debug("{}: {} -> {} -> {}", name, target, detour, original);
Expand Down

0 comments on commit 516b705

Please sign in to comment.