summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-02-24 14:28:19 +0100
committerSimon Rettberg2023-02-24 14:28:19 +0100
commit3b6ff5610bca3d2a9654b44dc576c5ddb96d69c5 (patch)
treea3b47221f38793580550fd97fc919afd6ae1d4e6
parent[thrift] Add call for retrieving session data from access token (diff)
downloadmaster-sync-shared-3b6ff5610bca3d2a9654b44dc576c5ddb96d69c5.tar.gz
master-sync-shared-3b6ff5610bca3d2a9654b44dc576c5ddb96d69c5.tar.xz
master-sync-shared-3b6ff5610bca3d2a9654b44dc576c5ddb96d69c5.zip
thrift wrapper: Only repeat calls if we get a transport/protocol exception
-rw-r--r--src/main/java/org/openslx/thrifthelper/ThriftHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java
index 28b0fa6..e53eff9 100644
--- a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java
+++ b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java
@@ -13,6 +13,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.thrift.TException;
import org.apache.thrift.TServiceClient;
+import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.transport.TTransportException;
import org.openslx.thrifthelper.ThriftManager.ErrorCallback;
@@ -73,7 +74,8 @@ class ThriftHandler<T extends TServiceClient> implements InvocationHandler
return method.invoke( client, args );
} catch ( InvocationTargetException e ) {
cause = e.getCause();
- if ( cause != null && ! ( cause instanceof TException ) ) {
+ if ( cause != null && ! ( cause instanceof TTransportException )
+ && ! ( cause instanceof TProtocolException ) ) {
throw cause;
}
freeClient( client );