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>
diff --git a/pw_rpc/channel.cc b/pw_rpc/channel.cc
index 2c67c39..70f4262 100644
--- a/pw_rpc/channel.cc
+++ b/pw_rpc/channel.cc
@@ -31,7 +31,8 @@
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 6de176e..c86837d 100644
--- a/pw_rpc/nanopb/nanopb_method.cc
+++ b/pw_rpc/nanopb/nanopb_method.cc
@@ -53,7 +53,7 @@
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 @@
// 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 4c0d27d..0a7127c 100644
--- a/pw_rpc/py/pw_rpc/callback_client.py
+++ b/pw_rpc/py/pw_rpc/callback_client.py
@@ -236,7 +236,7 @@
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):