mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-22 17:45:48 +00:00
added logging to several places concerning futures
This commit is contained in:
@@ -41,7 +41,7 @@ public class MessageEmbedListener implements MessageReceivedListener {
|
||||
Consumer<CachedMessage> cachedMessageConsumer = cachedMessage -> messageEmbedService.embedLink(cachedMessage, message.getTextChannel(), cause, message);
|
||||
messageCache.getMessageFromCache(messageEmbedLink.getServerId(), messageEmbedLink.getChannelId(), messageEmbedLink.getMessageId()).thenAccept(cachedMessageConsumer)
|
||||
.exceptionally(throwable -> {
|
||||
log.error("Error when embedding link.", throwable);
|
||||
log.error("Error when embedding link for message {}", message.getId(), throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,7 +101,10 @@ public class MessageEmbedServiceBean implements MessageEmbedService {
|
||||
messageCache.getMessageFromCache(messageEmbedLink.getServerId(), messageEmbedLink.getChannelId(), messageEmbedLink.getMessageId())
|
||||
.thenAccept(cachedMessage ->
|
||||
self.embedLink(cachedMessage, target, reason, embeddingMessage)
|
||||
)
|
||||
).exceptionally(throwable -> {
|
||||
log.error("Message retrieval from cache failed for message {}.", messageEmbedLink.getMessageId(), throwable);
|
||||
return null;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -121,6 +124,10 @@ public class MessageEmbedServiceBean implements MessageEmbedService {
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("Failed to post message embed.", e);
|
||||
}
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to send message for embedding the link for message {} in channel {} in server {}",
|
||||
cachedMessage.getMessageId(), cachedMessage.getChannelId(), cachedMessage.getServerId(), throwable);
|
||||
return null;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ public class StarboardServiceBean implements StarboardService {
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("Failed to post messages.", e);
|
||||
}
|
||||
}) .exceptionally(throwable -> {
|
||||
log.error("Failed to create starboard post for message {} in channel {} in server {}", message.getMessageId(), message.getChannelId(), message.getServerId(), throwable);
|
||||
return null;
|
||||
});
|
||||
|
||||
}
|
||||
@@ -125,6 +128,9 @@ public class StarboardServiceBean implements StarboardService {
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("Failed to post starboard post.", e);
|
||||
}
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to update starboard post {}.", post.getId(), throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,9 @@ public class SuggestionServiceBean implements SuggestionService {
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.warn("Failed to post suggestion", e);
|
||||
}
|
||||
}) .exceptionally(throwable -> {
|
||||
log.error("Failed to post suggestion {}", suggestion.getId(), throwable);
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
log.warn("Guild {} or member {} was not found when creating suggestion.", member.getGuild().getIdLong(), member.getIdLong());
|
||||
|
||||
Reference in New Issue
Block a user