Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TEndpointTransport extends TTransport

// update only: message size can shrink, but not grow
if (newSize > KnownMessageSize)
throw new TTransportException(TTransportException.END_OF_FILE, "ResetConsumedMessageSize: MaxMessageSize reached");
throw new TTransportException(TTransportException.MESSAGE_SIZE_LIMIT, 'ResetConsumedMessageSize: message size exceeds limit ${MaxMessageSize}');

KnownMessageSize = newSize;
RemainingMessageSize = newSize;
Expand All @@ -79,7 +79,7 @@ class TEndpointTransport extends TTransport
public override function CheckReadBytesAvailable(numBytes : Int64) : Void
{
if (RemainingMessageSize < numBytes || numBytes < 0)
throw new TTransportException(TTransportException.END_OF_FILE, 'CheckReadBytesAvailable(${numBytes}): MaxMessageSize reached, only ${RemainingMessageSize} bytes available');
throw new TTransportException(TTransportException.MESSAGE_SIZE_LIMIT, 'CheckReadBytesAvailable(${numBytes}): message size exceeds limit ${MaxMessageSize}, only ${RemainingMessageSize} bytes available');
}

// Consumes numBytes from the RemainingMessageSize.
Expand All @@ -92,7 +92,7 @@ class TEndpointTransport extends TTransport
else
{
RemainingMessageSize = 0;
throw new TTransportException(TTransportException.END_OF_FILE, 'CountConsumedMessageBytes(${numBytes}): MaxMessageSize reached');
throw new TTransportException(TTransportException.MESSAGE_SIZE_LIMIT, 'CountConsumedMessageBytes(${numBytes}): message size exceeds limit ${MaxMessageSize}');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class TTransportException extends TException {
public static inline var ALREADY_OPEN : Int = 2;
public static inline var TIMED_OUT : Int = 3;
public static inline var END_OF_FILE : Int = 4;
public static inline var CORRUPTED_DATA : Int = 5;
public static inline var MESSAGE_SIZE_LIMIT : Int = 6;

public function new(error : Int = UNKNOWN, message : String = "") {
super(message, error);
Expand Down
Loading