Improved exceptions
Many exceptions got an improvement due to changed class or description or details it is providing. Is not complete, needs to be done in patches in the regions, where it is needed, since some are just swallowed. Removed total usage of pure RuntimeExceptions to 0.
This commit is contained in:
@@ -40,7 +40,7 @@ public abstract class AppEngPacket
|
||||
|
||||
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
|
||||
{
|
||||
throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
|
||||
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
|
||||
}
|
||||
|
||||
public final int getPacketID()
|
||||
@@ -50,7 +50,7 @@ public abstract class AppEngPacket
|
||||
|
||||
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
|
||||
{
|
||||
throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." );
|
||||
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." );
|
||||
}
|
||||
|
||||
protected void configureWrite( ByteBuf data )
|
||||
|
||||
@@ -130,7 +130,7 @@ public class AppEngPacketHandlerBase
|
||||
REVERSE_LOOKUP.put( this.packetClass, this );
|
||||
|
||||
if( this.packetConstructor == null )
|
||||
throw new RuntimeException( "Invalid Packet Class, must be constructable on DataInputStream" );
|
||||
throw new IllegalStateException( "Invalid Packet Class " + c + ", must be constructable on DataInputStream" );
|
||||
}
|
||||
|
||||
public static PacketTypes getPacket( int id )
|
||||
|
||||
@@ -228,10 +228,10 @@ public enum GuiBridge implements IGuiHandler
|
||||
String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
|
||||
|
||||
if( start.equals( guiClass ) )
|
||||
throw new RuntimeException( "Unable to find gui class" );
|
||||
throw new IllegalStateException( "Unable to find gui class" );
|
||||
this.Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), guiClass );
|
||||
if( this.Gui == null )
|
||||
throw new RuntimeException( "Cannot Load class: " + guiClass );
|
||||
throw new IllegalStateException( "Cannot Load class: " + guiClass );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
public boolean CorrectTileOrPart( Object tE )
|
||||
{
|
||||
if( this.Tile == null )
|
||||
throw new RuntimeException( "This Gui Cannot use the standard Handler." );
|
||||
throw new IllegalArgumentException( "This Gui Cannot use the standard Handler." );
|
||||
|
||||
return this.Tile.isInstance( tE );
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
|
||||
throw new IllegalStateException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
|
||||
}
|
||||
|
||||
Object o = target.newInstance( inventory, tE );
|
||||
@@ -364,7 +364,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
catch( Throwable t )
|
||||
{
|
||||
throw new RuntimeException( t );
|
||||
throw new IllegalStateException( t );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,14 +462,14 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
|
||||
throw new IllegalStateException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
|
||||
}
|
||||
|
||||
return target.newInstance( inventory, tE );
|
||||
}
|
||||
catch( Throwable t )
|
||||
{
|
||||
throw new RuntimeException( t );
|
||||
throw new IllegalStateException( t );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class PacketInventoryAction extends AppEngPacket
|
||||
{
|
||||
|
||||
if( Platform.isClient() )
|
||||
throw new RuntimeException( "invalid packet, client cannot post inv actions with stacks." );
|
||||
throw new IllegalStateException( "invalid packet, client cannot post inv actions with stacks." );
|
||||
|
||||
this.action = action;
|
||||
this.slot = slot;
|
||||
|
||||
Reference in New Issue
Block a user