Only catch Exceptions not Errors (#1186)

This commit is contained in:
glowredman authored and GitHub committed 2025-12-21 14:14:50 +01:00
1 parent 941fc88484
commit a32f9ca244
20 files changed
+45 -39

No files matched your search

@@ -47,7 +47,7 @@ public class ShaderPackSelectionList extends IrisGuiSlot {
try {
names = Iris.getShaderpacksDirectoryManager().enumerate();
} catch (Throwable e) {
} catch (Exception e) {
Iris.logger.error("Error reading files while constructing selection UI", e);
// Not translating this since it's going to be seen very rarely,
@@ -67,7 +67,7 @@ public class CommentDirectiveParser {
try {
actual = testCase.get();
} catch (Throwable e) {
} catch (Exception e) {
System.err.println("Test \"" + name + "\" failed with an exception:");
e.printStackTrace();
@@ -67,8 +67,8 @@ public class PBRAtlasTexture extends AutoClosableAbstractTexture {
for (TextureAtlasSprite sprite : sprites.values()) {
try {
uploadSprite(sprite);
} catch (Throwable throwable) {
CrashReport crashReport = CrashReport.makeCrashReport(throwable, "Stitching texture atlas");
} catch (Exception e) {
CrashReport crashReport = CrashReport.makeCrashReport(e, "Stitching texture atlas");
CrashReportCategory crashReportCategory = crashReport.makeCategory("Texture being stitched together");
crashReportCategory.addCrashSection("Atlas path", id);
crashReportCategory.addCrashSection("Sprite", sprite);
@@ -97,7 +97,7 @@ public class PBRAtlasTexture extends AutoClosableAbstractTexture {
try {
upload(atlasWidth, atlasHeight, mipLevel, anisotropicFiltering);
return true;
} catch (Throwable t) {
} catch (Exception t) {
Iris.logger.error("Could not upload PBR texture", t);
return false;
}