Skip to content

Commit

Permalink
try-catch all sign initializations; resolves #799
Browse files Browse the repository at this point in the history
  • Loading branch information
Sataniel98 committed Jun 30, 2020
1 parent c172d8e commit a1b163e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public void initialize() {
continue;
}

dSign.initialize();
try {
dSign.initialize();
} catch (Exception exception) {
dSign.markAsErroneous("An error occurred while initializing a sign of the type " + dSign.getName()
+ ". This is not a user error. Please report the following stacktrace to the developer of the plugin:");
exception.printStackTrace();
}
if (!dSign.hasTriggers()) {
dSign.trigger(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ public DungeonSign createDungeonSign(Sign sign, String[] lines) {
}

if (dSign.isOnDungeonInit()) {
dSign.initialize();
try {
dSign.initialize();
} catch (Exception exception) {
dSign.markAsErroneous("An error occurred while initializing a sign of the type " + dSign.getName()
+ ". This is not a user error. Please report the following stacktrace to the developer of the plugin:");
exception.printStackTrace();
}
if (!dSign.isErroneous() && dSign.isSetToAir()) {
dSign.setToAir();
}
Expand Down

0 comments on commit a1b163e

Please sign in to comment.