JAkutenshi commented on code in PR #7606:
URL: https://github.com/apache/ignite-3/pull/7606#discussion_r2871988834


##########
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java:
##########
@@ -471,6 +471,29 @@ public static Throwable unwrapCause(Throwable e) {
         return e;
     }
 
+    /**
+     * Unwraps exception cause until the given cause type from the given 
wrapper exception. If there is no any cause of the expected type
+     * then the original exception will be thrown.
+     *
+     * @param e The exception to unwrap.
+     * @param causeType Expected type of a cause to look up.
+     * @return The desired cause of the exception.
+     * @throws Throwable Original exception in case if there is no cause with 
given type.
+     */
+    public static <T extends Throwable> T unwrapCause(Throwable e, Class<T> 
causeType) {
+        Throwable cause = e;
+
+        while (!causeType.isAssignableFrom(cause.getClass()) && 
cause.getCause() != null) {

Review Comment:
   TODOs are added https://issues.apache.org/jira/browse/IGNITE-28026



-- 
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