From 92a212c8c8dc8b3f676c1bbc7dce8481897ae8da Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 21 Feb 2013 18:17:44 +1100 Subject: [PATCH] Cleaner exceptions. --- proxy/src/main/java/net/md_5/bungee/ServerConnector.java | 4 ++-- proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index ff34e393..b080164e 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -106,9 +106,9 @@ public class ServerConnector extends PacketHandler return connect( user, def, false ); } else { - if ( ex instanceof KickException ) + if ( ex instanceof RuntimeException ) { - throw (KickException) ex; + throw (RuntimeException) ex; } throw new RuntimeException( "Could not connect to target server " + Util.exception( ex ) ); } diff --git a/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java b/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java index ac14eb5f..d7c20cce 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java @@ -215,7 +215,7 @@ public abstract class DefinedPacket implements DataOutput } } - Preconditions.checkState( ret != null, "Don't know how to deal with packet ID {0}", Util.hex( id ) ); + Preconditions.checkState( ret != null, "Don't know how to deal with packet ID %s", Util.hex( id ) ); return ret; }