Skip to content

Commit

Permalink
Localization: If admin adds extra parameters, or other parsing failur…
Browse files Browse the repository at this point in the history
…es, happens on a message, the error will now be trapped and logged to the console without formatting.
  • Loading branch information
rbluer committed Mar 28, 2024
1 parent be2512c commit 23dedde
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,21 @@ public void supportSubmitVersion(CommandSender sender

PrisonPasteChat pasteChat = new PrisonPasteChat( getSupportName(), getSupportURLs() );

String helpURL = pasteChat.post( text.toString() );
String helpURL = "(Failure in running the commmand.)";

try {
helpURL = pasteChat.post( text.toString() );
}
catch (Exception e) {
Output.get().logRaw(

String.format(
"Failed to paste support info to the support server: %s "
+ "raw message: [%s]",
e.getMessage(),
text.toString()
) );
}

getSupportURLs().put( "Submit version:", helpURL );

Expand Down

0 comments on commit 23dedde

Please sign in to comment.