Skip to content

Commit

Permalink
Merge commit '454af28e037506c194747a1f75fa5e51fe9983ff'
Browse files Browse the repository at this point in the history
  • Loading branch information
janaakhterov committed Feb 1, 2022
2 parents 4bbc89f + 454af28 commit 8f39013
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/src/main/java/com/hedera/hashgraph/sdk/Executable.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public O execute(Client client, Duration timeout) throws TimeoutException, Prech
if(grpcRequest.shouldRetryExceptionally(lastException)) {
continue;
} else {
throw grpcRequest.mapStatusException();
throw new RuntimeException(lastException);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ com.hedera.hashgraph.sdk.AccountInfoTest.toProtobuf=[
"ownedNfts_": 0,
"maxAutomaticTokenAssociations_": 0,
"alias_": {
"hash": 0,
"hash": 1,
"bytes": "",
"validUtf8": true,
"empty": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void executeRetriableErrorDuringCall() {
throw new StatusRuntimeException(io.grpc.Status.ABORTED);
};

assertThrows(PrecheckStatusException.class, () -> tx.execute(client));
assertThrows(RuntimeException.class, () -> tx.execute(client));

verify(node3).channelFailedToConnect();
verify(node4).channelFailedToConnect();
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public class Mocker implements AutoCloseable {
var responseIndex = index.getAndIncrement();

if (responseIndex >= response.size()) {
System.out.println("AAAAAAAAA");
responseObserver.onError(Status.Code.ABORTED.toStatus().asRuntimeException());
return;
}

var r = response.get(responseIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void exitOnAborted() throws PrecheckStatusException, TimeoutException, Interrupt
var responses = List.of(responses1);

try (var mocker = Mocker.withResponses(responses)) {
Assertions.assertThrows(StatusRuntimeException.class, () -> new AccountBalanceQuery().setAccountId(new AccountId(10)).execute(mocker.client));
Assertions.assertThrows(RuntimeException.class, () -> new AccountBalanceQuery().setAccountId(new AccountId(10)).execute(mocker.client));
}
}

Expand Down

0 comments on commit 8f39013

Please sign in to comment.