Unwrap exception on FoundationDB insert

This commit is contained in:
Ameya Lokare authored and ravi-signal committed 2026-08-31 13:28:59 -05:00
1 parent 5469341fd6
commit d4c145b339
1 file changed
+2 -1
@@ -39,6 +39,7 @@ import org.whispersystems.textsecuregcm.identity.ServiceIdentifier;
import org.whispersystems.textsecuregcm.metrics.MetricsUtil;
import org.whispersystems.textsecuregcm.push.RedisMessageAvailabilityManager;
import org.whispersystems.textsecuregcm.storage.foundationdb.FoundationDbMessageStore;
import org.whispersystems.textsecuregcm.util.ExceptionUtils;
import org.whispersystems.textsecuregcm.util.UUIDUtil;
import reactor.core.observability.micrometer.Micrometer;
import reactor.core.publisher.Flux;
@@ -132,7 +133,7 @@ public class MessagesManager {
foundationDbInsertFuture =
foundationDbMessageStore.insert(new AciServiceIdentifier(accountIdentifier), minimizedMessagesByDeviceId)
.exceptionally(e -> {
if (e instanceof FDBException fdbException) {
if (ExceptionUtils.unwrap(e) instanceof final FDBException fdbException) {
Metrics.counter(INSERT_FDB_EXCEPTIONS_COUNTER_NAME, "code", String.valueOf(fdbException.getCode()))
.increment();
} else {