v0.2.3: changed how some of the code deals with exception. More visible errors, but better error reporting. These methods should never fail for any reason other than an IOException anyway, so the intent here is that if they do fail for another reason, it is worth one user's game session so that I can get a bug report.
This commit is contained in:
parent
0014888514
commit
ddc3786b44
|
@ -382,9 +382,9 @@ public class Dungeon {
|
||||||
observe();
|
observe();
|
||||||
try {
|
try {
|
||||||
saveAll();
|
saveAll();
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
//TODO: I need to add analytics code to this or something.
|
/*This only catches IO errors. Yes, this means things can do wrong, and they can go wrong catastrophically.
|
||||||
//Silent failure is really bad, don't want to interrupt the user but I do want to know if this fails.
|
But when they do the user will get a nice 'report this issue' dialogue, and I can fix the bug.*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ public class Dungeon {
|
||||||
Bundle.write( bundle, output );
|
Bundle.write( bundle, output );
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
|
|
||||||
GamesInProgress.setUnknown( hero.heroClass );
|
GamesInProgress.setUnknown( hero.heroClass );
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,12 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon;
|
package com.shatteredpixel.shatteredpixeldungeon;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class GamesInProgress {
|
public class GamesInProgress {
|
||||||
|
|
||||||
private static HashMap<HeroClass, Info> state = new HashMap<HeroClass, Info>();
|
private static HashMap<HeroClass, Info> state = new HashMap<HeroClass, Info>();
|
||||||
|
@ -41,7 +42,7 @@ public class GamesInProgress {
|
||||||
info = new Info();
|
info = new Info();
|
||||||
Dungeon.preview( info, bundle );
|
Dungeon.preview( info, bundle );
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
info = null;
|
info = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ public enum Rankings {
|
||||||
OutputStream output = Game.instance.openFileOutput( RANKINGS_FILE, Game.MODE_PRIVATE );
|
OutputStream output = Game.instance.openFileOutput( RANKINGS_FILE, Game.MODE_PRIVATE );
|
||||||
Bundle.write( bundle, output );
|
Bundle.write( bundle, output );
|
||||||
output.close();
|
output.close();
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ public enum Rankings {
|
||||||
totalNumber = records.size();
|
totalNumber = records.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user