v0.9.3a: improved the verbosity of text errors reports

This commit is contained in:
Evan Debenham
2021-06-12 22:35:10 -04:00
parent b2df851b08
commit fcae90e52c

View File

@@ -97,7 +97,11 @@ public class RenderedText extends Image {
for (char c : text.toCharArray()) { for (char c : text.toCharArray()) {
BitmapFont.Glyph g = font.getData().getGlyph(c); BitmapFont.Glyph g = font.getData().getGlyph(c);
if (g == null || (g.id != c)){ if (g == null || (g.id != c)){
Game.reportException(new Throwable("font file " + font.toString() + " could not render " + c)); String toException = text;
if (toException.length() > 30){
toException = toException.substring(0, 30) + "...";
}
Game.reportException(new Throwable("font file " + font.toString() + " could not render " + c + " from string: " + toException));
} }
} }