lhotari commented on code in PR #23522:
URL: https://github.com/apache/pulsar/pull/23522#discussion_r1818628495


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/MetaStoreImpl.java:
##########
@@ -398,10 +398,11 @@ private static ManagedLedgerInfo 
updateMLInfoTimestamp(ManagedLedgerInfo info) {
     }
 
     private static MetaStoreException getException(Throwable t) {
-        if (t.getCause() instanceof 
MetadataStoreException.BadVersionException) {
-            return new 
ManagedLedgerException.BadVersionException(t.getMessage());
+        Throwable actEx = FutureUtil.unwrapCompletionException(t);
+        if (actEx instanceof MetadataStoreException.BadVersionException) {
+            return new 
ManagedLedgerException.BadVersionException(actEx.getMessage());

Review Comment:
   gotcha. How about wrapping the original exception instance with `return new 
ManagedLedgerException.BadVersionException(actEx)` instead of just wrapping the 
message? 
   That would preserve stacktraces.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to