forked from SteamWar/SteamWar
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:
-3
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user