mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-09 01:04:04 +00:00
[AB-323] improving logging when using whenComplete
This commit is contained in:
@@ -149,6 +149,9 @@ public class AssignableRoleButtonClickedListener implements ButtonClickedListene
|
||||
self.persistAssignableUser(member, payload, false);
|
||||
});
|
||||
}
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to perform role change in assignable role place.", throwable);
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
assignableRoleService.removeAssignableRoleFromUser(roleById, member)
|
||||
|
||||
@@ -205,16 +205,15 @@ public class AssignableRolePlaceServiceBean implements AssignableRolePlaceServic
|
||||
if (throwable != null) {
|
||||
log.warn("Not able to delete old messages of assignable role place {} in server {}.", assignablePlaceId, serverId);
|
||||
}
|
||||
try {
|
||||
self.createAssignableRolePlacePost(serverId, assignablePlaceId)
|
||||
.thenAccept(unused1 -> postingFuture.complete(null))
|
||||
.exceptionally(innerThrowable -> {
|
||||
postingFuture.completeExceptionally(innerThrowable);
|
||||
return null;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
postingFuture.completeExceptionally(ex);
|
||||
}
|
||||
self.createAssignableRolePlacePost(serverId, assignablePlaceId)
|
||||
.thenAccept(unused1 -> postingFuture.complete(null))
|
||||
.exceptionally(innerThrowable -> {
|
||||
postingFuture.completeExceptionally(innerThrowable);
|
||||
return null;
|
||||
});
|
||||
}).exceptionally(throwable -> {
|
||||
postingFuture.completeExceptionally(throwable);
|
||||
return null;
|
||||
});
|
||||
return postingFuture;
|
||||
}
|
||||
@@ -361,17 +360,16 @@ public class AssignableRolePlaceServiceBean implements AssignableRolePlaceServic
|
||||
if (throwable != null) {
|
||||
log.warn("Not able to delete old messages of assignable role place {} in server {}.", assignablePlaceId, serverId);
|
||||
}
|
||||
try {
|
||||
self.setupAssignableRolePlaceInChannel(serverId, assignablePlaceId, newChannel)
|
||||
.thenAccept(unused1 -> self.updateAssignableRolePlaceChannel(name, newChannel))
|
||||
.thenAccept(unused1 -> returnFuture.complete(null))
|
||||
.exceptionally(innerThrowable -> {
|
||||
returnFuture.completeExceptionally(innerThrowable);
|
||||
return null;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
returnFuture.completeExceptionally(ex);
|
||||
}
|
||||
self.setupAssignableRolePlaceInChannel(serverId, assignablePlaceId, newChannel)
|
||||
.thenAccept(unused1 -> self.updateAssignableRolePlaceChannel(name, newChannel))
|
||||
.thenAccept(unused1 -> returnFuture.complete(null))
|
||||
.exceptionally(innerThrowable -> {
|
||||
returnFuture.completeExceptionally(innerThrowable);
|
||||
return null;
|
||||
});
|
||||
}).exceptionally(throwable -> {
|
||||
returnFuture.completeExceptionally(throwable);
|
||||
return null;
|
||||
});
|
||||
|
||||
return returnFuture;
|
||||
|
||||
Reference in New Issue
Block a user