Try to log upload errors within discord instead of failing silently.

This commit is contained in:
Aleksei Gryczewski 2021-02-10 23:59:12 -05:00
parent a017bd4e00
commit 09071534a5

View File

@ -86,7 +86,16 @@ public class ImageListener implements MessageCreateListener {
.setDeleteHash(upload.getDeleteHash());
storeAndLog(event, channel, outfitBuilder);
}).exceptionally(ExceptionLogger.get());
}).exceptionally(e -> {
EmbedBuilder errorEmbed = new EmbedBuilder()
.setTitle("Error!")
.setColor(Color.RED)
.setAuthor(event.getApi().getYourself())
.setDescription(e.getMessage());
event.getChannel().sendMessage(errorEmbed);
return null;
});
}
private void store(MessageCreateEvent event, ServerTextChannel channel, MessageAttachment image) {