Skip to content

Commit 4b18ab6

Browse files
committed
Updated Exception Messages For Nag Dialogs
- Changed exception messages in `AdminStrainNagDialog` and `DeploymentShortfallNagDialog` to include the class name dynamically using `getClass().getSimpleName()`. - Enhances error clarity by specifying the exact dialog class in the exception output.
1 parent dcdcd95 commit 4b18ab6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

MekHQ/src/mekhq/gui/dialog/nagDialogs/AdminStrainNagDialog.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ public AdminStrainNagDialog(final Campaign campaign) {
8585
MekHQ.getMHQOptions().setNagDialogIgnore(NAG_ADMIN_STRAIN, true);
8686
cancelAdvanceDay = false;
8787
}
88-
default -> throw new IllegalStateException("Unexpected value in AdminStrainNagDialog: " + choiceIndex);
88+
default -> throw new IllegalStateException("Unexpected value in " +
89+
getClass().getSimpleName() +
90+
": " +
91+
choiceIndex);
8992
}
9093
}
9194

MekHQ/src/mekhq/gui/dialog/nagDialogs/DeploymentShortfallNagDialog.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ public DeploymentShortfallNagDialog(final Campaign campaign) {
9090
MekHQ.getMHQOptions().setNagDialogIgnore(NAG_SHORT_DEPLOYMENT, true);
9191
cancelAdvanceDay = false;
9292
}
93-
default -> throw new IllegalStateException("Unexpected value in AdminStrainNagDialog: " + choiceIndex);
93+
default -> throw new IllegalStateException("Unexpected value in " +
94+
getClass().getSimpleName() +
95+
": " +
96+
choiceIndex);
9497
}
9598
}
9699

0 commit comments

Comments
 (0)