Ask who needed to know#
Every swallowed error has an audience that no longer hears about the failure. Name it before you answer:
- A calling function that would branch on the error, retry, or report it.
- A test that should fail when the code under it fails.
- A process supervisor or script that reads the exit status.
- A person reading logs during an incident.
If none of them needs the failure, the bot has found a pattern, not a defect. If one of them does, check whether the code tells them some other way: a log line at the right level, a return value, a metric. A catch that logs and continues is a decision about who hears, and it can be the right one.
A test helper that hid its own server's failure#
In November 2026, a pull request to googleapis/google-cloud-rust deflaked timeout tests by rewriting the loops that run the test echo servers. Before the change, the gRPC test server discarded the result of the server future:
let _ = Server::builder()
.add_service(
google::test::v1::echo_service_server::EchoServiceServer::new(echo)
.max_decoding_message_size(usize::MAX),
)
.serve_with_incoming(stream)
.await;
gemini-code-assist's review summary said "the gRPC server loop ignores the result of the server future," and recommended "that it be unwrapped to avoid swallowing errors, consistent with the HTTP server implementation". Review summary The inline thread is resolved, and GitHub hides its text, so this guide relies on the summary.
The claim is checkable in the same diff. The HTTP echo server in that pull request already called axum::serve(listener, app).await.unwrap(), and the gRPC one did not. In Rust, let _ = is the explicit way to discard a value marked #[must_use], and Result is one, so the compiler accepts the discard without a warning. The audience here is the test: if the server fails to start or stops with an error, a test that times out waiting for it reports a timeout rather than the cause.
The author followed the comment. Commit 7fb2deb, "test(gax-internal): unwrap grpc serve result", says it unwraps the result "to match echo-server and fail loudly on unexpected errors." The merged loop reads r = &mut serve => { r.unwrap(); break; }. Pull request It merged on 4 November 2026.
The same merged code keeps one discard on purpose: let _ = active_sleeps_rx.changed().await;. Tokio's watch::Receiver::changed returns an error only once the channel is closed, which needs every sender dropped, and here the sender lives inside the server future the loop is still polling. A comment on that line would have deserved a dismissal for the reason the first one deserved a change: whether anyone needs the failure.
A caught error kept on purpose#
Two weeks later, a pull request to GoogleCloudPlatform/python-docs-samples added a sample that deletes a Spanner backup schedule. The sample catches NotFound and GoogleAPICallError, prints a message to stderr and returns. gemini-code-assist objected that "Catching and swallowing API exceptions (exceptions.NotFound and exceptions.GoogleAPICallError)" inside the function "makes it difficult for programmatic callers to detect and handle failures," and that as a script "the process will exit with a status code of 0 (success)" "even if the deletion failed." It suggested letting the exceptions propagate. Review comment
The exit status claim is correct. A Python script that catches an exception, prints to stderr and returns normally exits with status 0; a short script with that shape printed its message and exit=0 when run. The sys.exit documentation describes the status a script reports.
The author declined: "Standalone documentation snippets here intentionally catch google.api_core.exceptions inside the sample function and print actionable diagnostic messages to stderr" "so readers can see concrete error handling directly in context, so we are keeping the try/except block." Author's reply The pull request merged on 19 November 2026.
The code is a documentation sample, and its reader is a person learning which exceptions the client raises. The pull request's tests pin the choice: they make the mocked client raise NotFound and PermissionDenied, a GoogleAPICallError subclass, and assert that stderr starts with the expected message. The bot was right about the mechanism and wrong about who the code serves. A team that copies the sample into a job runner has a different audience and should take the bot's advice.
Decide from the evidence#
| What you find | Response |
|---|---|
| A caller, test or exit status depends on the failure, and nothing else reports it | Change: propagate, return the error, or fail the test |
| The failure is reported another way the audience reads, such as a log at error level or a returned status | Dismiss, and name where it is reported |
| The swallow is deliberate and the reason is written beside the code or in the pull request | Dismiss with that reason |
| The swallow is deliberate but undocumented | Add a one-line comment saying why, then dismiss |
| You cannot tell whether the error ever occurs | Add a test that forces the error and see what the caller observes |
The last row is often the cheapest: mocking the call to raise, as the Spanner tests do, shows in one run where the failure surfaces. If the unhandled-error guide fits the comment better, because nothing catches the error at all, use that one instead.
Write the reason down#
A dismissal without a reason costs the next reviewer the same investigation, and some bots repeat the comment on the next push. Put the reason in a code comment when it concerns the code, such as "cleanup is best effort; the process is exiting", and in the pull request reply when it concerns scope. Record what you checked and what you did not, so a later reader can reconstruct the dismissal without rerunning it.