sk0x50 commented on code in PR #928:
URL: https://github.com/apache/ignite-3/pull/928#discussion_r933141968
##########
modules/metastorage-client/src/main/java/org/apache/ignite/internal/metastorage/client/CursorImpl.java:
##########
@@ -125,13 +129,13 @@ public boolean hasNext() {
.get();
}
} catch (InterruptedException | ExecutionException e) {
- if (e.getCause() != null &&
e.getCause().getClass().equals(NodeStoppingException.class)) {
+ if (e.getCause() instanceof NodeStoppingException) {
return false;
}
LOG.debug("Unable to evaluate cursor hasNext command", e);
- throw new IgniteInternalException(e);
+ throw withCause(MetaStorageException::new,
CURSOR_EXECUTION_ERR, e);
Review Comment:
This cause is checked inside the `withCause` implementation:
```
Throwable unwrapped = unwrapCause(t);
```
where `unwrap` if the following:
```
public static Throwable unwrapCause(Throwable e) {
while ((e instanceof CompletionException || e instanceof
ExecutionException) && e.getCause() != null) {
e = e.getCause();
}
return e;
}
```
--
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]