diff --git a/pw_channel/stream_channel.cc b/pw_channel/stream_channel.cc index cf9ec6f788..9f8fba4beb 100644 --- a/pw_channel/stream_channel.cc +++ b/pw_channel/stream_channel.cc @@ -201,7 +201,7 @@ Poll StreamChannel::DoPendReadyToWrite(Context&) { return OkStatus(); } pw::Result StreamChannel::DoWrite( pw::multibuf::MultiBuf&& data) { - write_state_.SendData(std::move(data)); + PW_TRY(write_state_.SendData(std::move(data))); const uint32_t token = write_token_++; return CreateWriteToken(token); } diff --git a/pw_cpu_exception_cortex_m/snapshot.cc b/pw_cpu_exception_cortex_m/snapshot.cc index 83367fff3f..07e4158f6b 100644 --- a/pw_cpu_exception_cortex_m/snapshot.cc +++ b/pw_cpu_exception_cortex_m/snapshot.cc @@ -56,8 +56,10 @@ Status CaptureMainStack( thread_state = thread::proto::pwpb::ThreadState::Enum::RUNNING; PW_LOG_DEBUG("Thread state: RUNNING"); } - encoder.WriteState(thread_state); - encoder.WriteName(as_bytes(span(std::string_view(thread_name)))); + // TODO: https://pwbug.dev/357138093 - Review IgnoreError calls in this file. + encoder.WriteState(thread_state).IgnoreError(); + encoder.WriteName(as_bytes(span(std::string_view(thread_name)))) + .IgnoreError(); const thread::StackContext thread_ctx = { .thread_name = thread_name, @@ -77,7 +79,7 @@ Status SnapshotCpuState( { pwpb::ArmV7mCpuState::StreamEncoder cpu_state_encoder = snapshot_encoder.GetArmv7mCpuStateEncoder(); - DumpCpuStateProto(cpu_state_encoder, cpu_state); + DumpCpuStateProto(cpu_state_encoder, cpu_state).IgnoreError(); } return snapshot_encoder.status(); } diff --git a/pw_crypto/size_report/ecdsa_p256_verify.cc b/pw_crypto/size_report/ecdsa_p256_verify.cc index 7818a6eb8f..0aa4098e9d 100644 --- a/pw_crypto/size_report/ecdsa_p256_verify.cc +++ b/pw_crypto/size_report/ecdsa_p256_verify.cc @@ -45,6 +45,7 @@ int main() { pw::bloat::BloatThisBinary(); pw::crypto::ecdsa::VerifyP256Signature( - STR_TO_BYTES(PUBKEY), STR_TO_BYTES(DIGEST), STR_TO_BYTES(SIGNATURE)); + STR_TO_BYTES(PUBKEY), STR_TO_BYTES(DIGEST), STR_TO_BYTES(SIGNATURE)) + .IgnoreError(); return 0; } diff --git a/pw_hdlc/BUILD.bazel b/pw_hdlc/BUILD.bazel index 40acc4a7d7..3eb7dbd667 100644 --- a/pw_hdlc/BUILD.bazel +++ b/pw_hdlc/BUILD.bazel @@ -92,9 +92,11 @@ cc_library( ":default_addresses", ":pw_hdlc", ":rpc_channel_output", + "//pw_assert", "//pw_log", "//pw_log_basic:headers", "//pw_rpc/system_server:facade", + "//pw_status", "//pw_stream:sys_io_stream", ], ) diff --git a/pw_hdlc/hdlc_sys_io_system_server.cc b/pw_hdlc/hdlc_sys_io_system_server.cc index 8652e8bd5c..2fa3295e68 100644 --- a/pw_hdlc/hdlc_sys_io_system_server.cc +++ b/pw_hdlc/hdlc_sys_io_system_server.cc @@ -14,12 +14,14 @@ #include +#include "pw_assert/check.h" #include "pw_hdlc/decoder.h" #include "pw_hdlc/default_addresses.h" #include "pw_hdlc/encoded_size.h" #include "pw_hdlc/rpc_channel.h" #include "pw_log_basic/log_basic.h" #include "pw_rpc_system_server/rpc_server.h" +#include "pw_status/try.h" #include "pw_stream/sys_io_stream.h" namespace pw::rpc::system_server { @@ -47,8 +49,8 @@ void Init() { // Send log messages to HDLC address 1. This prevents logs from interfering // with pw_rpc communications. pw::log_basic::SetOutput([](std::string_view log) { - pw::hdlc::WriteUIFrame( - pw::hdlc::kDefaultLogAddress, as_bytes(span(log)), writer); + PW_CHECK_OK(pw::hdlc::WriteUIFrame( + pw::hdlc::kDefaultLogAddress, as_bytes(span(log)), writer)); }); } @@ -63,14 +65,11 @@ Status Start() { while (true) { std::byte byte; - Status ret_val = pw::sys_io::ReadByte(&byte); - if (!ret_val.ok()) { - return ret_val; - } + PW_TRY(pw::sys_io::ReadByte(&byte)); if (auto result = decoder.Process(byte); result.ok()) { hdlc::Frame& frame = result.value(); if (frame.address() == hdlc::kDefaultRpcAddress) { - server.ProcessPacket(frame.data()); + PW_TRY(server.ProcessPacket(frame.data())); } } } diff --git a/pw_hdlc/size_report/hdlc_size_report.cc b/pw_hdlc/size_report/hdlc_size_report.cc index b8cf35e44a..70b0afcf00 100644 --- a/pw_hdlc/size_report/hdlc_size_report.cc +++ b/pw_hdlc/size_report/hdlc_size_report.cc @@ -72,7 +72,9 @@ void HdlcSizeReport() { std::array data; std::fill(data.begin(), data.end(), std::byte(0)); stream::MemoryWriterBuffer<250> destination; - destination.Write(data); + if (destination.Write(data).ok()) { + PW_LOG_INFO("Began write successfully"); + } if (destination.Write(GetBufferSpan()).ok()) { PW_LOG_INFO("Wrote successfully"); } @@ -82,7 +84,7 @@ void HdlcSizeReport() { #endif #ifdef ENABLE_ENCODE - hdlc::WriteUIFrame(123, data, destination); + hdlc::WriteUIFrame(123, data, destination).IgnoreError(); #endif #ifdef ENABLE_DECODE diff --git a/pw_log_tokenized/base64_over_hdlc.cc b/pw_log_tokenized/base64_over_hdlc.cc index 997f6cf557..1f8942aecf 100644 --- a/pw_log_tokenized/base64_over_hdlc.cc +++ b/pw_log_tokenized/base64_over_hdlc.cc @@ -42,8 +42,10 @@ extern "C" void pw_log_tokenized_HandleLog( PrefixedBase64Encode(log_buffer, size_bytes); // HDLC-encode the Base64 string via a SysIoWriter. + // TODO: https://pwbug.dev/357136096 - Maybe don't ignore the error? hdlc::WriteUIFrame( - kBase64LogHdlcAddress, as_bytes(span(base64_string)), writer); + kBase64LogHdlcAddress, as_bytes(span(base64_string)), writer) + .IgnoreError(); } } // namespace pw::log_tokenized diff --git a/pw_protobuf/size_report/decoder_incremental.cc b/pw_protobuf/size_report/decoder_incremental.cc index 064f57931d..416fa3e5ad 100644 --- a/pw_protobuf/size_report/decoder_incremental.cc +++ b/pw_protobuf/size_report/decoder_incremental.cc @@ -43,30 +43,30 @@ int main() { while (decoder.Next().ok()) { switch (decoder.FieldNumber()) { case 1: - decoder.ReadInt32(&test_int32); + decoder.ReadInt32(&test_int32).IgnoreError(); break; case 2: - decoder.ReadSint32(&test_sint32); + decoder.ReadSint32(&test_sint32).IgnoreError(); break; case 3: - decoder.ReadString(&str); + decoder.ReadString(&str).IgnoreError(); break; case 4: - decoder.ReadFloat(&f); + decoder.ReadFloat(&f).IgnoreError(); break; case 5: - decoder.ReadDouble(&d); + decoder.ReadDouble(&d).IgnoreError(); break; // Extra fields over decoder_full. case 21: - decoder.ReadInt32(&test_int32); + decoder.ReadInt32(&test_int32).IgnoreError(); break; case 22: - decoder.ReadUint32(&uint); + decoder.ReadUint32(&uint).IgnoreError(); break; case 23: - decoder.ReadSint32(&test_sint32); + decoder.ReadSint32(&test_sint32).IgnoreError(); break; } } diff --git a/pw_protobuf/size_report/decoder_partial.cc b/pw_protobuf/size_report/decoder_partial.cc index 561335e260..ba0f33065f 100644 --- a/pw_protobuf/size_report/decoder_partial.cc +++ b/pw_protobuf/size_report/decoder_partial.cc @@ -42,19 +42,19 @@ int main() { while (decoder.Next().ok()) { switch (decoder.FieldNumber()) { case 1: - decoder.ReadInt32(&test_int32); + decoder.ReadInt32(&test_int32).IgnoreError(); break; case 2: - decoder.ReadSint32(&test_sint32); + decoder.ReadSint32(&test_sint32).IgnoreError(); break; case 3: - decoder.ReadString(&str); + decoder.ReadString(&str).IgnoreError(); break; case 4: - decoder.ReadFloat(&f); + decoder.ReadFloat(&f).IgnoreError(); break; case 5: - decoder.ReadDouble(&d); + decoder.ReadDouble(&d).IgnoreError(); break; } } diff --git a/pw_protobuf/size_report/oneof_codegen_comparison.cc b/pw_protobuf/size_report/oneof_codegen_comparison.cc index 27317db0d2..263677292b 100644 --- a/pw_protobuf/size_report/oneof_codegen_comparison.cc +++ b/pw_protobuf/size_report/oneof_codegen_comparison.cc @@ -59,17 +59,17 @@ PW_NO_INLINE void BasicEncode() { volatile bool has_timestamp = true; volatile bool has_has_value = false; if (which_key == KeyType::KEY_STRING) { - encoder.WriteString(1, "test"); + encoder.WriteString(1, "test").IgnoreError(); } else if (which_key == KeyType::KEY_TOKEN) { - encoder.WriteFixed32(2, 99999); + encoder.WriteFixed32(2, 99999).IgnoreError(); } if (has_timestamp) { - encoder.WriteInt64(3, 1663003467); + encoder.WriteInt64(3, 1663003467).IgnoreError(); } if (has_has_value) { - encoder.WriteBool(4, true); + encoder.WriteBool(4, true).IgnoreError(); } { @@ -189,17 +189,17 @@ PW_NO_INLINE void BasicEncode() { volatile bool has_timestamp = true; volatile bool has_has_value = false; if (which_key == KeyType::KEY_STRING) { - encoder.WriteKeyString("test"); + encoder.WriteKeyString("test").IgnoreError(); } else if (which_key == KeyType::KEY_TOKEN) { - encoder.WriteKeyToken(99999); + encoder.WriteKeyToken(99999).IgnoreError(); } if (has_timestamp) { - encoder.WriteTimestamp(1663003467); + encoder.WriteTimestamp(1663003467).IgnoreError(); } if (has_has_value) { - encoder.WriteHasValue(true); + encoder.WriteHasValue(true).IgnoreError(); } { @@ -334,8 +334,7 @@ PW_NO_INLINE void BasicEncode() { if (which_key == KeyType::KEY_STRING) { message.key_string.SetEncoder( [](ResponseInfo::StreamEncoder& key_string_encoder) -> pw::Status { - key_string_encoder.WriteKeyString("test"); - return pw::OkStatus(); + return key_string_encoder.WriteKeyString("test"); }); } else if (which_key == KeyType::KEY_TOKEN) { message.key_token = 99999; diff --git a/pw_protobuf/size_report/proto_bloat.cc b/pw_protobuf/size_report/proto_bloat.cc index 9d58844229..b46485692e 100644 --- a/pw_protobuf/size_report/proto_bloat.cc +++ b/pw_protobuf/size_report/proto_bloat.cc @@ -96,14 +96,14 @@ class FakeMessageEncoder : public protobuf::StreamEncoder { public: FakeMessageEncoder(stream::Writer& writer) : protobuf::StreamEncoder(writer, ByteSpan()) {} - void DoBloat() { Write(ByteSpan(), kFakeTable); } + void DoBloat() { Write(ByteSpan(), kFakeTable).IgnoreError(); } }; class FakeMessageDecoder : public protobuf::StreamDecoder { public: FakeMessageDecoder(stream::Reader& reader) : protobuf::StreamDecoder(reader) {} - void DoBloat() { Read(ByteSpan(), kFakeTable); } + void DoBloat() { Read(ByteSpan(), kFakeTable).IgnoreError(); } }; void CodeToSetUpSizeReportEnvironment() { @@ -135,8 +135,8 @@ void Dependencies() { std::array buffer; stream::NullStream null_stream; stream::MemoryWriter memory_writer(buffer); - memory_writer.Write(buffer); - null_stream.Write(buffer); + memory_writer.Write(buffer).IgnoreError(); + null_stream.Write(buffer).IgnoreError(); stream::MemoryReader memory_reader(buffer); memory_reader.Read(buffer).IgnoreError(); } @@ -145,68 +145,70 @@ void CodeToPullInProtoEncoder() { std::array buffer; protobuf::MemoryEncoder encoder(buffer); - encoder.WriteUint32(1, 1); - encoder.WritePackedUint32(1, GetIntegerArray()); - encoder.WriteRepeatedUint32(1, GetIntegerVector()); + encoder.WriteUint32(1, 1).IgnoreError(); + encoder.WritePackedUint32(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedUint32(1, GetIntegerVector()).IgnoreError(); - encoder.WriteInt32(1, 1); - encoder.WritePackedInt32(1, GetIntegerArray()); - encoder.WriteRepeatedInt32(1, GetIntegerVector()); + encoder.WriteInt32(1, 1).IgnoreError(); + encoder.WritePackedInt32(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedInt32(1, GetIntegerVector()).IgnoreError(); - encoder.WriteUint64(1, 1); - encoder.WritePackedUint64(1, GetIntegerArray()); - encoder.WriteRepeatedUint64(1, GetIntegerVector()); + encoder.WriteUint64(1, 1).IgnoreError(); + encoder.WritePackedUint64(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedUint64(1, GetIntegerVector()).IgnoreError(); - encoder.WriteInt64(1, 1); - encoder.WritePackedInt64(1, GetIntegerArray()); - encoder.WriteRepeatedInt64(1, GetIntegerVector()); + encoder.WriteInt64(1, 1).IgnoreError(); + encoder.WritePackedInt64(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedInt64(1, GetIntegerVector()).IgnoreError(); - encoder.WriteSint32(1, 1); - encoder.WritePackedSint32(1, GetIntegerArray()); - encoder.WriteRepeatedSint32(1, GetIntegerVector()); + encoder.WriteSint32(1, 1).IgnoreError(); + encoder.WritePackedSint32(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedSint32(1, GetIntegerVector()).IgnoreError(); - encoder.WriteSint64(1, 1); - encoder.WritePackedSint64(1, GetIntegerArray()); - encoder.WriteRepeatedSint64(1, GetIntegerVector()); + encoder.WriteSint64(1, 1).IgnoreError(); + encoder.WritePackedSint64(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedSint64(1, GetIntegerVector()).IgnoreError(); - encoder.WriteFixed32(1, 1); - encoder.WritePackedFixed32(1, GetIntegerArray()); - encoder.WriteRepeatedFixed32(1, GetIntegerVector()); + encoder.WriteFixed32(1, 1).IgnoreError(); + encoder.WritePackedFixed32(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedFixed32(1, GetIntegerVector()).IgnoreError(); - encoder.WriteFixed64(1, 1); - encoder.WritePackedFixed64(1, GetIntegerArray()); - encoder.WriteRepeatedFixed64(1, GetIntegerVector()); + encoder.WriteFixed64(1, 1).IgnoreError(); + encoder.WritePackedFixed64(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedFixed64(1, GetIntegerVector()).IgnoreError(); - encoder.WriteSfixed32(1, 1); - encoder.WritePackedSfixed32(1, GetIntegerArray()); - encoder.WriteRepeatedSfixed32(1, GetIntegerVector()); + encoder.WriteSfixed32(1, 1).IgnoreError(); + encoder.WritePackedSfixed32(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedSfixed32(1, GetIntegerVector()).IgnoreError(); - encoder.WriteSfixed64(1, 1); - encoder.WritePackedSfixed64(1, GetIntegerArray()); - encoder.WriteRepeatedSfixed64(1, GetIntegerVector()); + encoder.WriteSfixed64(1, 1).IgnoreError(); + encoder.WritePackedSfixed64(1, GetIntegerArray()).IgnoreError(); + encoder.WriteRepeatedSfixed64(1, GetIntegerVector()).IgnoreError(); { protobuf::StreamEncoder child = encoder.GetNestedEncoder(0xc01dfee7); - child.WriteFloat(234, 3.14f); - child.WritePackedFloat(234, GetFloatArray()); - child.WriteRepeatedFloat(234, GetFloatVector()); + child.WriteFloat(234, 3.14f).IgnoreError(); + child.WritePackedFloat(234, GetFloatArray()).IgnoreError(); + child.WriteRepeatedFloat(234, GetFloatVector()).IgnoreError(); - child.WriteFloat(234, 3.14); - child.WritePackedDouble(234, GetDoubleArray()); - child.WriteRepeatedDouble(234, GetDoubleVector()); + child.WriteFloat(234, 3.14).IgnoreError(); + child.WritePackedDouble(234, GetDoubleArray()).IgnoreError(); + child.WriteRepeatedDouble(234, GetDoubleVector()).IgnoreError(); - child.WriteBool(7, true); - child.WritePackedBool(8, GetBoolArray()); - child.WriteRepeatedBool(8, GetBoolVector()); + child.WriteBool(7, true).IgnoreError(); + child.WritePackedBool(8, GetBoolArray()).IgnoreError(); + child.WriteRepeatedBool(8, GetBoolVector()).IgnoreError(); - encoder.WriteBytes(93, as_bytes(span(GetDoubleArray()))); - encoder.WriteString(21343, kTestString); + encoder.WriteBytes(93, as_bytes(span(GetDoubleArray()))) + .IgnoreError(); + encoder.WriteString(21343, kTestString).IgnoreError(); } stream::NullStream null_stream; protobuf::StreamEncoder stream_encoder(null_stream, buffer); - stream_encoder.WriteBytesFromStream(3636, null_stream, 10824, buffer); + stream_encoder.WriteBytesFromStream(3636, null_stream, 10824, buffer) + .IgnoreError(); } void CodeToPullInTableEncoder() { diff --git a/pw_router/size_report/base.cc b/pw_router/size_report/base.cc index a4bd839f78..a3455269ac 100644 --- a/pw_router/size_report/base.cc +++ b/pw_router/size_report/base.cc @@ -44,8 +44,8 @@ int main() { PW_LOG_INFO("pw_StatusString %s", pw::OkStatus().str()); std::array packet_buffer; - pw::sys_io::ReadBytes(packet_buffer); - pw::sys_io::WriteBytes(packet_buffer); + pw::sys_io::ReadBytes(packet_buffer).IgnoreError(); + pw::sys_io::WriteBytes(packet_buffer).IgnoreError(); return static_cast(packet.payload); } diff --git a/pw_router/size_report/static_router_with_one_route.cc b/pw_router/size_report/static_router_with_one_route.cc index 1b1a9832ad..926e427245 100644 --- a/pw_router/size_report/static_router_with_one_route.cc +++ b/pw_router/size_report/static_router_with_one_route.cc @@ -73,14 +73,26 @@ int main() { PW_LOG_INFO("pw_StatusString %s", pw::OkStatus().str()); std::array packet_buffer; - pw::sys_io::ReadBytes(packet_buffer); - pw::sys_io::WriteBytes(packet_buffer); + if (!pw::sys_io::ReadBytes(packet_buffer).ok()) { + PW_LOG_ERROR("Failed to read packet"); + return 0; + } + if (!pw::sys_io::WriteBytes(packet_buffer).ok()) { + PW_LOG_ERROR("Failed to write packet"); + return 0; + } BasicPacketParser parser; while (true) { - pw::sys_io::ReadBytes(packet_buffer); - router.RoutePacket(packet_buffer, parser); + if (!pw::sys_io::ReadBytes(packet_buffer).ok()) { + PW_LOG_ERROR("Failed to read packet"); + return 0; + } + if (!router.RoutePacket(packet_buffer, parser).ok()) { + PW_LOG_ERROR("Failed to route packet"); + return 0; + } } return static_cast(packet.payload); diff --git a/pw_system/crash_snapshot.cc b/pw_system/crash_snapshot.cc index 219d09cafe..dcff851c8f 100644 --- a/pw_system/crash_snapshot.cc +++ b/pw_system/crash_snapshot.cc @@ -71,14 +71,16 @@ Status CrashSnapshot::CaptureMetadata( // TODO: b/354770559 - generate a snapshot UUID. std::optional snapshot_uuid; if (snapshot_uuid.has_value()) { - metadata_encoder.WriteSnapshotUuid(snapshot_uuid.value()); + // TODO: https://pwbug.dev/357138320 - Review IgnoreError calls in this + // file. + metadata_encoder.WriteSnapshotUuid(snapshot_uuid.value()).IgnoreError(); } if (!reason.empty()) { - metadata_encoder.WriteReason(as_bytes(span(reason))); + metadata_encoder.WriteReason(as_bytes(span(reason))).IgnoreError(); } - metadata_encoder.WriteFatal(true); + metadata_encoder.WriteFatal(true).IgnoreError(); // TODO: b/354775975 - populate the metadata with version, build uuid // and project name. @@ -91,7 +93,7 @@ Status CrashSnapshot::CaptureMetadata( Status CrashSnapshot::CaptureLogs( snapshot::pwpb::Snapshot::StreamEncoder& snapshot_encoder) { log::pwpb::LogEntries::StreamEncoder encoder(writer_, ByteSpan()); - multisink::UnsafeDumpMultiSinkLogs(GetMultiSink(), encoder); + multisink::UnsafeDumpMultiSinkLogs(GetMultiSink(), encoder).IgnoreError(); return snapshot_encoder.status(); } diff --git a/pw_system/hdlc_rpc_server.cc b/pw_system/hdlc_rpc_server.cc index a457b03581..474e7b00f7 100644 --- a/pw_system/hdlc_rpc_server.cc +++ b/pw_system/hdlc_rpc_server.cc @@ -115,14 +115,17 @@ class RpcDispatchThread final : public thread::ThreadCore { PW_LOG_INFO("Running RPC server"); while (true) { auto ret_val = GetReader().Read(data); - if (ret_val.ok()) { - for (std::byte byte : ret_val.value()) { - if (auto result = decoder.Process(byte); result.ok()) { - hdlc::Frame& frame = result.value(); - PW_TRACE_SCOPE("RPC process frame"); - if (frame.address() == PW_SYSTEM_DEFAULT_RPC_HDLC_ADDRESS || - frame.address() == PW_SYSTEM_LOGGING_RPC_HDLC_ADDRESS) { - server.ProcessPacket(frame.data()); + if (!ret_val.ok()) { + continue; + } + for (std::byte byte : ret_val.value()) { + if (auto result = decoder.Process(byte); result.ok()) { + hdlc::Frame& frame = result.value(); + PW_TRACE_SCOPE("RPC process frame"); + if (frame.address() == PW_SYSTEM_DEFAULT_RPC_HDLC_ADDRESS || + frame.address() == PW_SYSTEM_LOGGING_RPC_HDLC_ADDRESS) { + if (!server.ProcessPacket(frame.data()).ok()) { + PW_LOG_ERROR("Failed to process packet"); } } } diff --git a/pw_transfer/integration_test/client.cc b/pw_transfer/integration_test/client.cc index 6d66e85ba7..77c5fbaf94 100644 --- a/pw_transfer/integration_test/client.cc +++ b/pw_transfer/integration_test/client.cc @@ -96,8 +96,9 @@ pw::Status PerformTransferActions(const pw::transfer::ClientConfig& config) { transfer_thread, kDefaultMaxWindowSizeBytes); - client.set_max_retries(config.max_retries()); - client.set_max_lifetime_retries(config.max_lifetime_retries()); + // TODO: https://pwbug.dev/357145010 - Don't IgnoreError here. + client.set_max_retries(config.max_retries()).IgnoreError(); + client.set_max_lifetime_retries(config.max_lifetime_retries()).IgnoreError(); Status status = pw::OkStatus(); for (int i = 0; i < num_actions; i++) { diff --git a/pw_unit_test/BUILD.bazel b/pw_unit_test/BUILD.bazel index 9898d3785b..7edfe61895 100644 --- a/pw_unit_test/BUILD.bazel +++ b/pw_unit_test/BUILD.bazel @@ -396,6 +396,7 @@ cc_library( deps = [ ":pw_unit_test", ":rpc_service", + "//pw_assert", "//pw_hdlc:default_addresses", "//pw_log", "//pw_rpc", diff --git a/pw_unit_test/rpc_main.cc b/pw_unit_test/rpc_main.cc index 799e8c1423..399af6f72b 100644 --- a/pw_unit_test/rpc_main.cc +++ b/pw_unit_test/rpc_main.cc @@ -12,6 +12,7 @@ // License for the specific language governing permissions and limitations under // the License. +#include "pw_assert/check.h" #include "pw_log/log.h" #include "pw_rpc_system_server/rpc_server.h" #include "pw_unit_test/unit_test_service.h" @@ -27,7 +28,7 @@ int main() { pw::rpc::system_server::Server().RegisterService(unit_test_service); PW_LOG_INFO("Starting pw_rpc server"); - pw::rpc::system_server::Start(); + PW_CHECK_OK(pw::rpc::system_server::Start()); return 0; } diff --git a/targets/rp2040/device_handler.cc b/targets/rp2040/device_handler.cc index 5aea1bc00b..733ef990ed 100644 --- a/targets/rp2040/device_handler.cc +++ b/targets/rp2040/device_handler.cc @@ -23,7 +23,9 @@ void RebootSystem() { watchdog_reboot(0, 0, 0); } void CapturePlatformMetadata( snapshot::pwpb::Metadata::StreamEncoder& metadata_encoder) { - metadata_encoder.WriteCpuArch(snapshot::pwpb::CpuArchitecture::Enum::ARMV6M); + // TODO: https://pwbug.dev/357132837 - Review if IgnoreError is correct here. + metadata_encoder.WriteCpuArch(snapshot::pwpb::CpuArchitecture::Enum::ARMV6M) + .IgnoreError(); } Status CaptureCpuState( diff --git a/third_party/freertos/pw_assert_stack_overflow_hook.cc b/third_party/freertos/pw_assert_stack_overflow_hook.cc index 1826030751..f5e51b5e42 100644 --- a/third_party/freertos/pw_assert_stack_overflow_hook.cc +++ b/third_party/freertos/pw_assert_stack_overflow_hook.cc @@ -28,7 +28,8 @@ extern "C" void vApplicationStackOverflowHook(TaskHandle_t, char* pcTaskName) { // Copy the task name to a buffer in case it is corrupted. static char temp_thread_name_buffer[configMAX_TASK_NAME_LEN]; - pw::string::Copy(pcTaskName, temp_thread_name_buffer); + // TODO: https://pwbug.dev/357139112 - Review the IgnoreError call. + pw::string::Copy(pcTaskName, temp_thread_name_buffer).IgnoreError(); PW_CRASH("Stack overflow for task %s", temp_thread_name_buffer); }