dant3 commented on code in PR #3373:
URL: https://github.com/apache/ignite-3/pull/3373#discussion_r1519932090
##########
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java:
##########
@@ -951,7 +951,7 @@ <T extends Throwable> T copy(MethodHandle constructor, UUID
traceId, int code, S
* </code></pre>
*
*/
- private static class UtilException extends Throwable {
+ private static class UtilException extends RuntimeException {
Review Comment:
Sure. The reason is basically correctness. Currently this exception is
never caught but it seems it's designed exactly to be caught.
It's usually bad idea to catch Throwable because it's hierarchy contains
Error class, which includes OutOfMemoryError for instance. On the other hand
catching Exceptions, be it RuntineException or not is fine.
If that class is a RuntimeException it will be caught by catch(Exception)
blocks but will remain unchecked since it's a runtime exception, which is what
was the intended behaviour here.
--
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]