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:
thatsIch
2015-03-23 10:14:35 +01:00
parent 817163dbf6
commit 3783ae8619
76 changed files with 288 additions and 290 deletions
+10 -6
View File
@@ -25,6 +25,7 @@ package appeng.api.config;
import java.util.EnumSet;
import javax.annotation.Nonnull;
public enum Settings
@@ -55,16 +56,19 @@ public enum Settings
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) );
private final EnumSet values;
private final EnumSet<? extends Enum<?>> values;
Settings( EnumSet set )
Settings( @Nonnull EnumSet<? extends Enum<?>> possibleOptions )
{
if( set == null || set.isEmpty() )
throw new RuntimeException( "Invalid configuration." );
this.values = set;
if ( possibleOptions.isEmpty() )
{
throw new IllegalArgumentException( "Tried to instantiate an empty setting." );
}
this.values = possibleOptions;
}
public EnumSet getPossibleValues()
public EnumSet<? extends Enum<?>> getPossibleValues()
{
return this.values;
}