v2.3.0: fixed a few cases of error message spam
This commit is contained in:
@@ -176,6 +176,9 @@ public class FileUtils {
|
|||||||
public static Bundle bundleFromFile( String fileName ) throws IOException{
|
public static Bundle bundleFromFile( String fileName ) throws IOException{
|
||||||
try {
|
try {
|
||||||
FileHandle file = getFileHandle( fileName );
|
FileHandle file = getFileHandle( fileName );
|
||||||
|
if (!file.exists() || file.isDirectory() || file.length() == 0) {
|
||||||
|
throw new IOException("file does not exist!");
|
||||||
|
}
|
||||||
return bundleFromStream(file.read());
|
return bundleFromStream(file.read());
|
||||||
} catch (GdxRuntimeException e){
|
} catch (GdxRuntimeException e){
|
||||||
//game classes expect an IO exception, so wrap the GDX exception in that
|
//game classes expect an IO exception, so wrap the GDX exception in that
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ public class InterlevelScene extends PixelScene {
|
|||||||
else if (error.getMessage() != null &&
|
else if (error.getMessage() != null &&
|
||||||
error.getMessage().equals("old save")) errorMsg = Messages.get(this, "io_error");
|
error.getMessage().equals("old save")) errorMsg = Messages.get(this, "io_error");
|
||||||
|
|
||||||
else throw new RuntimeException("fatal error occured while moving between floors. " +
|
else throw new RuntimeException("fatal error occurred while moving between floors. " +
|
||||||
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth, error);
|
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth, error);
|
||||||
|
|
||||||
add( new WndError( errorMsg ) {
|
add( new WndError( errorMsg ) {
|
||||||
@@ -326,11 +326,13 @@ public class InterlevelScene extends PixelScene {
|
|||||||
s += "\n";
|
s += "\n";
|
||||||
s += t.toString();
|
s += t.toString();
|
||||||
}
|
}
|
||||||
ShatteredPixelDungeon.reportException(
|
//we care about reporting game logic exceptions, not slow IO
|
||||||
new RuntimeException("waited more than 10 seconds on levelgen. " +
|
if (!s.contains("FileUtils.bundleToFile")){
|
||||||
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth + " trace:" +
|
ShatteredPixelDungeon.reportException(
|
||||||
s)
|
new RuntimeException("waited more than 10 seconds on levelgen. " +
|
||||||
);
|
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth + " trace:" +
|
||||||
|
s));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user