Skip to content

Commit 532c02c

Browse files
okunzcopybara-github
authored andcommitted
Additional logging
PiperOrigin-RevId: 742655283 Change-Id: If3d1f582798f7fb0c1aef8e233f9f5dabe4207a4
1 parent 3d14f29 commit 532c02c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

sandboxed_api/sandbox2/comms.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ bool Comms::SendTLV(uint32_t tag, size_t length, const void* value) {
252252
bool Comms::RecvString(std::string* v) {
253253
uint32_t tag;
254254
if (!RecvTLV(&tag, v)) {
255+
if (IsConnected()) {
256+
SAPI_RAW_LOG(ERROR, "RecvString failed for (%s)", name_.c_str());
257+
}
255258
return false;
256259
}
257260

@@ -271,6 +274,9 @@ bool Comms::SendString(const std::string& v) {
271274
bool Comms::RecvBytes(std::vector<uint8_t>* buffer) {
272275
uint32_t tag;
273276
if (!RecvTLV(&tag, buffer)) {
277+
if (IsConnected()) {
278+
SAPI_RAW_LOG(ERROR, "RecvBytes failed for (%s)", name_.c_str());
279+
}
274280
return false;
275281
}
276282
if (tag != kTagBytes) {
@@ -446,10 +452,7 @@ bool Comms::RecvProtoBuf(google::protobuf::MessageLite* message) {
446452
std::vector<uint8_t> bytes;
447453
if (!RecvTLV(&tag, &bytes)) {
448454
if (IsConnected()) {
449-
SAPI_RAW_PLOG(ERROR, "RecvProtoBuf failed for (%s)", name_);
450-
} else {
451-
Terminate();
452-
SAPI_RAW_VLOG(2, "Connection terminated (%s)", name_.c_str());
455+
SAPI_RAW_LOG(ERROR, "RecvProtoBuf failed for (%s)", name_.c_str());
453456
}
454457
return false;
455458
}

0 commit comments

Comments
 (0)