Java Code Examples for org.web3j.protocol.core.Response#Error

The following examples show how to use org.web3j.protocol.core.Response#Error . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebSocketService.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
private <T extends Notification<?>> void reportSubscriptionError(
        BehaviorSubject<T> subject, PlatonSubscribe subscriptionReply) {
    Response.Error error = subscriptionReply.getError();
    log.error("Subscription request returned error: {}", error.getMessage());
    subject.onError(
            new IOException(String.format(
                    "Subscription request failed with error: %s",
                    error.getMessage()
            ))
    );
}
 
Example 2
Source File: Web3jProxyContract.java    From asf-sdk with GNU General Public License v3.0 5 votes vote down vote up
private String mapErrorToMessage(Response.Error error) {
  return "Code: "
      + error.getCode()
      + "\nmessage: "
      + error.getMessage()
      + "\nData: "
      + error.getData();
}
 
Example 3
Source File: WebSocketService.java    From web3j with Apache License 2.0 5 votes vote down vote up
private <T extends Notification<?>> void reportSubscriptionError(
        BehaviorSubject<T> subject, EthSubscribe subscriptionReply) {
    Response.Error error = subscriptionReply.getError();
    log.error("Subscription request returned error: {}", error.getMessage());
    subject.onError(
            new IOException(
                    String.format(
                            "Subscription request failed with error: %s", error.getMessage())));
}
 
Example 4
Source File: Filter.java    From client-sdk-java with Apache License 2.0 4 votes vote down vote up
void throwException(Response.Error error) {
    throw new FilterException("Invalid request: "
            + (error == null ? "Unknown Error" : error.getMessage()));
}
 
Example 5
Source File: Filter.java    From etherscan-explorer with GNU General Public License v3.0 4 votes vote down vote up
void throwException(Response.Error error) {
    throw new FilterException("Invalid request: "
            + (error == null ? "Unknown Error" : error.getMessage()));
}
 
Example 6
Source File: Filter.java    From web3j with Apache License 2.0 4 votes vote down vote up
void throwException(Response.Error error) {
    throw new FilterException(
            "Invalid request: " + (error == null ? "Unknown Error" : error.getMessage()));
}