Fix app crash when payload is too large

Summary:
Fixes T40544233

Exceptions should be thrown by value, not as a pointer, or else catching by reference (the recommended practice) won't work.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14243337

fbshipit-source-id: 28677d7f1b3c025b67fb945f30116f3b751a89a8
This commit is contained in:
John Knox
2019-02-27 10:40:41 -08:00
committed by Facebook Github Bot
parent 0445a05e5b
commit 56576a84ce

View File

@@ -357,7 +357,7 @@ rsocket::Payload toRSocketPayload(dynamic data) {
json.substr(0, 100) + "..."; json.substr(0, 100) + "...";
log(logMessage); log(logMessage);
DCHECK_LE(payloadLength, maxPayloadSize); DCHECK_LE(payloadLength, maxPayloadSize);
throw new std::length_error(logMessage); throw std::length_error(logMessage);
} }
return payload; return payload;