You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "JAkutenshi (via GitHub)" <gi...@apache.org> on 2026/03/02 11:46:22 UTC

Re: [PR] IGNITE-26345 Wrap ExceptionInInitializerError that happens in contructor of IgniteImpl when launched without JVM options "--add-opens=..." [ignite-3]

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org