From 3b6ff5610bca3d2a9654b44dc576c5ddb96d69c5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Feb 2023 14:28:19 +0100 Subject: thrift wrapper: Only repeat calls if we get a transport/protocol exception --- src/main/java/org/openslx/thrifthelper/ThriftHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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 ); -- cgit v1.2.3-55-g7522