You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/07/25 11:00:09 UTC

[GitHub] [ignite-3] sk0x50 commented on a diff in pull request #949: IGNITE-17312 Java thin: Implement unified exception handling

sk0x50 commented on code in PR #949:
URL: https://github.com/apache/ignite-3/pull/949#discussion_r928749044


##########
modules/api/src/main/java/org/apache/ignite/lang/IgniteException.java:
##########
@@ -252,4 +254,30 @@ public int errorCode() {
     public UUID traceId() {
         return traceId;
     }
+
+
+    /**
+     * Wraps another exception in IgniteException, extracting {@link #traceId} and {@link #code} when the specified exception
+     * or one of its causes is an IgniteException itself.
+     *
+     * @param e Internal exception.
+     * @return Public exception.
+     */
+    public static IgniteException wrap(Throwable e) {
+        e = ExceptionUtils.unwrapCause(e);
+
+        if (e instanceof IgniteException) {

Review Comment:
   It seems to me that we need to add support for `IgniteCheckedException` as 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-unsubscribe@ignite.apache.org

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