rpuch commented on code in PR #4070:
URL: https://github.com/apache/ignite-3/pull/4070#discussion_r1678919212
##########
modules/core/src/main/java/org/apache/ignite/internal/lang/IgniteExceptionMapperUtil.java:
##########
@@ -84,9 +85,29 @@ static void registerMapping(
* @return Public exception.
*/
public static Throwable mapToPublicException(Throwable origin) {
+ return mapToPublicException(origin, ex -> new
IgniteException(INTERNAL_ERR, ex));
+ }
+
+ /**
+ * This method provides a mapping from internal exception to Ignite public
ones.
+ *
+ * <p>The rules of mapping are the following:</p>
+ * <ul>
+ * <li>any instance of {@link Error} is returned as is, except {@link
AssertionError}
+ * that will always be mapped to {@link IgniteException} with the
{@link Common#INTERNAL_ERR} error code.</li>
+ * <li>any instance of {@link IgniteException} or {@link
IgniteCheckedException} is returned as is.</li>
Review Comment:
I think that the fact that our exceptions extend public 'root' exceptions,
but get placed in internal packages, should be fixed, but not in this PR.
--
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]