aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyatt Hepler <hepler@google.com>2021-03-25 14:55:30 -0700
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-04-02 18:38:08 +0000
commitc2a520cd98e37aed511134ab0fd2a25a2ebe548a (patch)
treea61bf5e48a7d30535b0e8b2cbe8af0b102cfa68c
parent0616ee33d58465873a8f9ba53ba2f8ac205a8f6b (diff)
downloadpigweed-c2a520cd98e37aed511134ab0fd2a25a2ebe548a.tar.gz
pw_rpc: Make log messages more specific
Also remove unnecessary pylint: disable comment. Change-Id: I3acd427c8ea25d695f727787c74d39bfc0926a1f Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/39641 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Alexei Frolov <frolv@google.com>
-rw-r--r--pw_rpc/channel.cc3
-rw-r--r--pw_rpc/nanopb/nanopb_method.cc9
-rw-r--r--pw_rpc/py/pw_rpc/callback_client.py2
3 files changed, 8 insertions, 6 deletions
diff --git a/pw_rpc/channel.cc b/pw_rpc/channel.cc
index 2c67c391b..70f426214 100644
--- a/pw_rpc/channel.cc
+++ b/pw_rpc/channel.cc
@@ -31,7 +31,8 @@ Status Channel::Send(OutputBuffer& buffer, const internal::Packet& packet) {
Result encoded = packet.Encode(buffer.buffer_);
if (!encoded.ok()) {
- PW_LOG_ERROR("Failed to encode response packet to channel buffer");
+ PW_LOG_ERROR("Failed to encode RPC response packet to channel %u buffer",
+ static_cast<unsigned>(id()));
output().DiscardBuffer(buffer.buffer_);
buffer.buffer_ = {};
return Status::Internal();
diff --git a/pw_rpc/nanopb/nanopb_method.cc b/pw_rpc/nanopb/nanopb_method.cc
index 6de176e1b..c86837df8 100644
--- a/pw_rpc/nanopb/nanopb_method.cc
+++ b/pw_rpc/nanopb/nanopb_method.cc
@@ -53,7 +53,7 @@ bool NanopbMethod::DecodeRequest(Channel& channel,
return true;
}
- PW_LOG_WARN("Failed to decode request payload from channel %u",
+ PW_LOG_WARN("Nanopb failed to decode request payload from channel %u",
unsigned(channel.id()));
channel.Send(Packet::ServerError(request, Status::DataLoss()));
return false;
@@ -85,9 +85,10 @@ void NanopbMethod::SendResponse(Channel& channel,
// Re-acquire the buffer to encode an error packet.
response_buffer = channel.AcquireBuffer();
} else {
- PW_LOG_WARN("Failed to encode response packet for channel %u, status %u",
- unsigned(channel.id()),
- encoded.status().code());
+ PW_LOG_WARN(
+ "Nanopb failed to encode response packet for channel %u, status %u",
+ unsigned(channel.id()),
+ encoded.status().code());
}
channel.Send(response_buffer,
Packet::ServerError(request, Status::Internal()));
diff --git a/pw_rpc/py/pw_rpc/callback_client.py b/pw_rpc/py/pw_rpc/callback_client.py
index 4c0d27d75..0a7127c84 100644
--- a/pw_rpc/py/pw_rpc/callback_client.py
+++ b/pw_rpc/py/pw_rpc/callback_client.py
@@ -236,7 +236,7 @@ class StreamingResponses:
self.cancel()
raise RpcTimeout(self._method_client._rpc, timeout_s) # pylint: disable=protected-access
except:
- self.cancel() # pylint: disable=protected-access
+ self.cancel()
raise
def __iter__(self):