tpagectl: clientFromContext wrapper still swallows error #549

Closed
opened 2026-08-05 09:19:54 +00:00 by the.auditor · 1 comment
Owner

clientFromContext in cmd/tpagectl/main.go still swallows the error from client.FromContext and returns nil, keeping the #543 nil-footgun alive for anyone using the main-package accessor.

Now that client.FromContext returns (*Client, error), recommend removing the clientFromContext wrapper and updating its only usage (TestClientWiringHealth in cmd/tpagectl/main_test.go) to call client.FromContext and handle the error directly.

Ref: PR #548

`clientFromContext` in `cmd/tpagectl/main.go` still swallows the error from `client.FromContext` and returns `nil`, keeping the #543 nil-footgun alive for anyone using the main-package accessor. Now that `client.FromContext` returns `(*Client, error)`, recommend removing the `clientFromContext` wrapper and updating its only usage (`TestClientWiringHealth` in `cmd/tpagectl/main_test.go`) to call `client.FromContext` and handle the error directly. Ref: PR #548
Owner

Fixed in #634: the clientFromContext wrapper now propagates the error from client.FromContext, and TestClientWiringHealth handles it.

Fixed in #634: the `clientFromContext` wrapper now propagates the error from `client.FromContext`, and `TestClientWiringHealth` handles it.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#549
No description provided.