From 1370d25c2ff8435fd0eded305c44b359712b3b53 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 8 Nov 2022 14:20:12 +0100 Subject: [thrift] One more exception to suppress --- src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java index df526e3..3699267 100644 --- a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java +++ b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java @@ -1,5 +1,6 @@ package org.openslx.thrifthelper; +import java.net.SocketException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -89,6 +90,9 @@ public class TBinaryProtocolSafe extends TBinaryProtocol // ignore there. Let's hope it will stay ignored in the future. throw new TTransportException( TTransportException.END_OF_FILE ); } + } else if ( e.getCause() instanceof SocketException && e.getCause().getMessage().contains( " timed out" ) ) { + // Faaaake + throw new TTransportException( TTransportException.END_OF_FILE ); } else if ( e.getMessage().contains( "larger than max length" ) ) { // Also fake, since this one prints a whole stack trace compared to the other // message by AbstractNonblockingServer -- cgit v1.2.3-55-g7522