Skip to content

fix(gateway): say why the HTTP client could not be created - #180

Merged
fylorn merged 1 commit into
mainfrom
fix/http-client-error-chain
Sep 24, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/http-client-error-chain

Conversation

@fylorn

@fylorn fylorn commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Found while installing lite's rehearsal deb in a clean ubuntu:22.04: without ca-certificates, twcore serve exits with The HTTP client could not be created: builder error. reqwest keeps the cause in source().

  • One helper, outbound::client_error, unwraps the error chain. It replaces the three hand-rolled gw.config.http_client sites (public_client, client_for_provider, AppState::new).
  • The msg code, its sentence and its detail parameter are unchanged, so no translation contract changes.

Verified in a Linux container with SSL_CERT_FILE/SSL_CERT_DIR pointed at an empty dir:
Error: The HTTP client could not be created: builder error: unexpected error: No CA certificates were loaded from the system. With certificates present it listens normally. macOS: fmt, clippy -D warnings (workspace) and tw-gateway tests pass.

lite's deb now depends on ca-certificates (ThinkWatch-Lite#174); this covers the AppImage and any other install that ends up without roots.

🤖 Generated with Claude Code

reqwest's builder error only reports its outermost layer, so the
gateway failed to start with "The HTTP client could not be created:
builder error". The actual cause sits in source(). On a Linux box
without ca-certificates it is "No CA certificates were loaded from
the system".

The three client-building sites now go through one helper that
unwraps the chain. Code and parameters are unchanged; only the detail
text gets richer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit d76afee into main Sep 24, 2026
7 of 8 checks passed
@fylorn
fylorn deleted the fix/http-client-error-chain branch September 24, 2026 12:42
@fylorn fylorn mentioned this pull request Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant