From 9ec63487c2d82068ec9d909b5ba5d5f4d36b8843 Mon Sep 17 00:00:00 2001 From: Kodi Craft Date: Fri, 6 Sep 2024 12:45:05 +0200 Subject: [PATCH] display packet ID in hexadecimal --- apps/amethyst/lib/apps/connection_handler.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/amethyst/lib/apps/connection_handler.ex b/apps/amethyst/lib/apps/connection_handler.ex index 47371ae..0c921e7 100644 --- a/apps/amethyst/lib/apps/connection_handler.ex +++ b/apps/amethyst/lib/apps/connection_handler.ex @@ -80,8 +80,8 @@ alias ElixirSense.Log case connstate.handle(packet, version, state) do :ok -> state {:error, reason} -> - Logger.error("Error handling packet with ID #{id} in state #{connstate}: #{reason}") - send(self(), {:disconnect, "§cError handling packet #{id}:\n#{reason}"}) + Logger.error("Error handling packet with ID #{inspect(id, base: :hex)} in state #{connstate}: #{reason}") + send(self(), {:disconnect, "§cError handling packet #{inspect(id, base: :hex)}:\n#{reason}"}) state newstate -> if is_map(newstate) do @@ -93,8 +93,8 @@ alias ElixirSense.Log end rescue e -> - Logger.error("Error handling packet with ID #{id} in state #{connstate}: #{Exception.format(:error, e, __STACKTRACE__)}") - send(self(), {:disconnect, "§cError handling packet #{id}:\n#{Exception.format(:error, e, __STACKTRACE__)}"}) + Logger.error("Error handling packet with ID #{inspect(id, base: :hex)} in state #{connstate}: #{Exception.format(:error, e, __STACKTRACE__)}") + send(self(), {:disconnect, "§cError handling packet #{inspect(id, base: :hex)}:\n#{Exception.format(:error, e, __STACKTRACE__)}"}) state end end