From 16fb3761480aeee1cae1be06e5b9de237e2c7aac Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 25 May 2023 16:21:54 +0200 Subject: TBinaryProtocolSafe: Silence more annoying messages --- src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java index c3f4763..efa83c3 100644 --- a/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java +++ b/src/main/java/org/openslx/thrifthelper/TBinaryProtocolSafe.java @@ -105,9 +105,10 @@ public class TBinaryProtocolSafe extends TBinaryProtocol && ( e.getCause().getMessage().contains( " timed out" ) || e.getCause().getMessage().contains( "Connection reset" ) ) ) { // Faaaake throw new TTransportException( TTransportException.END_OF_FILE ); - } else if ( e.getMessage().contains( "larger than max length" ) ) { + } else if ( e.getMessage().contains( "larger than max length" ) || e.getMessage().contains( "Read a negative frame size" ) ) { // Also fake, since this one prints a whole stack trace compared to the other // message by AbstractNonblockingServer + LOGGER.debug( e.getMessage(), e ); throw new TTransportException( TTransportException.END_OF_FILE ); } throw e; @@ -117,7 +118,8 @@ public class TBinaryProtocolSafe extends TBinaryProtocol if ( size < 0 ) { int version = size & VERSION_MASK; if ( version != VERSION_1 ) { - throw new TProtocolException( TProtocolException.BAD_VERSION, "Bad version in readMessageBegin" ); + LOGGER.warn( getIp() + "Bad version (" + version + ") in readMessageBegin" ); + throw new TTransportException( TTransportException.END_OF_FILE ); } return new TMessage( readString(), (byte) ( size & 0x000000ff ), readI32() ); } else { -- cgit v1.2.3-55-g7522