rpuch commented on code in PR #4923:
URL: https://github.com/apache/ignite-3/pull/4923#discussion_r1893914232


##########
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java:
##########
@@ -332,6 +332,52 @@ public static String getFullStackTrace(Throwable 
throwable) {
         return sw.getBuffer().toString();
     }
 
+    /**
+     * Checks if passed in {@code 'Throwable'} has given class in {@code 
'cause'} hierarchy
+     * <b>including</b> that throwable itself.
+     * Note that this method follows includes {@link Throwable#getSuppressed()}
+     * into check.
+     *
+     * @param t Throwable to check (if {@code null}, {@code false} is 
returned).
+     * @param msg Message text that should be in cause.
+     * @param cls Cause classes to check (if {@code null} or empty, {@code 
false} is returned).
+     * @return {@code True} if one of the causing exception is an instance of 
passed in classes,
+     *      {@code false} otherwise.
+     */
+    public static boolean hasCause(@Nullable Throwable t, @Nullable String 
msg, Class<?> @Nullable... cls) {

Review Comment:
   >Do you mean something like as follows 
https://github.com/apache/ignite-3/blob/main/modules/api/src/main/java/org/apache/ignite/lang/util/TraceIdUtils.java#L42
 ?
   
   I thought I saw it elsewhere, but I cannot find that other place. Yes, the 
idea is reflected here well.



-- 
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-unsubscr...@ignite.apache.org

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

Reply via email to