Skip to content

Commit 089062d

Browse files
committed
Need to override one more method to correctly convert JsonRpc* exceptions to PushRelay* exceptions.
1 parent f40e4fd commit 089062d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.moera</groupId>
77
<artifactId>moeralib</artifactId>
8-
<version>0.17.11</version>
8+
<version>0.17.11.1</version>
99

1010
<name>moeralib</name>
1111
<description>Java library to interact with Moera decentralized social network</description>

src/main/java/org/moera/lib/pushrelay/PushRelay.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ protected <T> T fetch(TypeReference<T> result, String method, Object... paramete
5656
}
5757
}
5858

59+
@Override
60+
protected <T> T fetch(TypeReference<T> result, String method, Map<String, Object> parameters) {
61+
try {
62+
return super.fetch(result, method, parameters);
63+
} catch (JsonRpcException e) {
64+
throw new PushRelayException(e.getMessage());
65+
} catch (JsonRpcConnectionException e) {
66+
throw new PushRelayConnectionException(e.getMessage());
67+
} catch (JsonRpcApiException e) {
68+
throw new PushRelayApiException(e.getRpcError());
69+
}
70+
}
71+
5972
@Override
6073
public void register(String clientId, String nodeName, String lang, long signedAt, byte[] signature) {
6174
Map<String, Object> params = new HashMap<>();

0 commit comments

Comments
 (0)