sk0x50 commented on code in PR #928:
URL: https://github.com/apache/ignite-3/pull/928#discussion_r932380039
##########
modules/metastorage-client/src/main/java/org/apache/ignite/internal/metastorage/client/CursorImpl.java:
##########
@@ -159,19 +171,25 @@ public T next() {
} catch (InterruptedException | ExecutionException e) {
Throwable cause = e.getCause();
- if (cause != null) {
- if (cause.getClass().equals(NodeStoppingException.class)) {
- throw new NoSuchElementException();
- } else {
- if
(cause.getClass().equals(NoSuchElementException.class)) {
- throw (NoSuchElementException) cause;
- }
- }
+ if (cause instanceof NodeStoppingException) {
+ throw new NoSuchElementException();
+ }
+
+ if (cause instanceof NoSuchElementException) {
+ throw (NoSuchElementException) cause;
}
LOG.debug("Unable to evaluate cursor hasNext command", e);
- throw new IgniteInternalException(e);
+ if (e.getCause() instanceof IgniteInternalException) {
+ IgniteInternalException exception =
(IgniteInternalException) e.getCause();
+ throw new IgniteInternalException(exception.traceId(),
exception.code(), exception);
Review Comment:
Well, it makes sense to me. Will change.
--
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]