Skip to content

Commit

Permalink
Fix error message during warp sign creation (#5956)
Browse files Browse the repository at this point in the history
Fixes #5954
  • Loading branch information
JRoy authored Oct 21, 2024
1 parent a8452b4 commit cd06e73
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import net.ess3.api.IEssentials;
import net.ess3.api.TranslatableException;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;

import java.util.concurrent.CompletableFuture;
Expand All @@ -25,6 +26,10 @@ protected boolean onSignCreate(final ISign sign, final User player, final String
try {
ess.getWarps().getWarp(warpName);
} catch (final Exception ex) {
if (ex instanceof TranslatableException) {
final TranslatableException te = (TranslatableException) ex;
throw new SignException(ex, te.getTlKey(), te.getArgs());
}
throw new SignException(ex, "errorWithMessage", ex.getMessage());
}
final String group = sign.getLine(2);
Expand Down

0 comments on commit cd06e73

Please sign in to comment.