commit 341c3098fbb1b1752f35dcb3f38161ad621f894c parent 480e012f5582807a602b472e3476d4f640fed0be Author: Wim Dupont <wim@wimdupont.com> Date: Sun, 6 Nov 2022 09:18:29 +0100 clarify pvmrole error message Diffstat:
M | src/main/java/com/sxcy/sxcybot/listeners/admin/pvmrole/AddPvmListener.java | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/sxcy/sxcybot/listeners/admin/pvmrole/AddPvmListener.java b/src/main/java/com/sxcy/sxcybot/listeners/admin/pvmrole/AddPvmListener.java @@ -62,8 +62,11 @@ public class AddPvmListener implements PrivateListener { event.getChannel().sendMessage(e.getMessage()).queue(); } } catch (DataIntegrityViolationException e) { - if (e.getMessage() != null) + if (e.getRootCause() != null) { + privateChannel.sendMessage(e.getRootCause().getMessage()).queue(); + } else if (e.getMessage() != null) privateChannel.sendMessage(e.getMessage()).queue(); + privateChannel.sendMessage("Please try updating the existing PvM competitor instead.").queue(); } }, event, privateChannel); });