Improve error handling and logging in Techhider and TinyProtocol

Refined logging messages for clarity by replacing "Techhider" with "PacketInterceptor" where appropriate. Adjusted error handling in `TechhiderbugCommand` by removing redundant `flush` calls and properly logging exceptions during bug report generation. These changes aim to enhance maintainability and debugging.
This commit is contained in:
2025-04-29 18:04:58 +02:00
parent d6a5caf95d
commit 15bb92fbba
2 changed files with 3 additions and 6 deletions
@@ -71,10 +71,7 @@ public class TechhiderbugCommand implements CommandExecutor {
Bukkit.getOnlinePlayers().forEach(p -> writer.append(p.getName()).append(": ").append(String.join(" ", TinyProtocol.instance.getPlayerInterceptors().get(p).getChannel().pipeline().names())).append('\n'));
} catch (Exception e) {
writer.append("Error while generating bug report: ").append(e.getMessage()).append('\n');
writer.flush();
Bukkit.getLogger().log(Level.SEVERE, "Error while generating bug report", e);
} finally {
writer.flush();
}
SWException.log("Techhider-Bug reported by " + sender.getName() + ": " + Arrays.toString(args), writer.toString());