Skip to content

throw exception on unparseable HTTP status in Curl backend#68

Merged
toddr merged 1 commit intomainfrom
koan.toddr.bot/curl-unparseable-status-exception
Apr 6, 2026
Merged

throw exception on unparseable HTTP status in Curl backend#68
toddr merged 1 commit intomainfrom
koan.toddr.bot/curl-unparseable-status-exception

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

@toddr-bot toddr-bot commented Apr 5, 2026

What: Replace silent warning with structured exception when Curl backend receives an unparseable HTTP status line.

Why: The old code would silently corrupt responses by setting an empty reason and continuing to parse headers. In async pipelines, this silent failure is particularly dangerous since callers cannot catch warnings.

How: Throw Net::ACME2::X->create('Generic', ...) exception (consistent with existing codebase pattern) instead of warning. Exception propagates through promise chain rejection handler (already in place). Added t/Net-ACME2-Curl.t with 6 tests covering valid responses, unparseable status lines, and empty headers. All 295 tests pass.

@toddr-bot
Copy link
Copy Markdown
Contributor Author

Rebase: Throw exception on unparseable HTTP status in Curl backend

Branch koan.toddr.bot/curl-unparseable-status-exception rebased onto main and force-pushed.

Diff: 3 files changed, 96 insertions(+), 2 deletions(-)

Actions

  • Already-solved check: negative (confidence=high, reasoning=Curl.pm on main still uses warn + empty reason for unparseable status lines; the structured exceptio)
  • Rebased koan.toddr.bot/curl-unparseable-status-exception onto origin/main
  • Force-pushed koan.toddr.bot/curl-unparseable-status-exception to origin
  • CI check enqueued (async)

CI

CI will be checked asynchronously.


Automated by Kōan

@toddr-bot toddr-bot force-pushed the koan.toddr.bot/curl-unparseable-status-exception branch from c2f546f to 8754dc0 Compare April 6, 2026 01:13
toddr-bot added a commit that referenced this pull request Apr 6, 2026
Replace silent `warn` + continue with a structured exception when the
async Curl backend encounters an unparseable HTTP status line. The old
code would set reason to empty string and proceed, silently corrupting
the response with no indication of failure. In an async pipeline, this
is particularly dangerous since the caller cannot catch warnings.

Exception propagates through the promise chain's rejection handler,
which converts it to a 599/Internal Exception response consistent with
the existing error handling pattern.

Add comprehensive test suite covering valid responses, unparseable
status lines, and edge cases.
@toddr-bot toddr-bot changed the title Throw exception on unparseable HTTP status in Curl backend throw exception on unparseable HTTP status in Curl backend Apr 6, 2026
@toddr-bot toddr-bot force-pushed the koan.toddr.bot/curl-unparseable-status-exception branch from e3e09df to 4f177fc Compare April 6, 2026 01:28
@toddr-bot
Copy link
Copy Markdown
Contributor Author

Squash: 3 commits → 1

Branch koan.toddr.bot/curl-unparseable-status-exception was squashed and force-pushed.

Commit message

fix: throw exception on unparseable HTTP status in Curl backend

Replace silent `warn` + continue with a structured exception when the
async Curl backend encounters an unparseable HTTP status line. The old
code would set reason to empty string and proceed, silently corrupting
the response with no indication of failure. In an async pipeline, this
is particularly dangerous since the caller cannot catch warnings.

Exception propagates through the promise chain's rejection handler,
which converts it to a 599/Internal Exception response consistent with
the existing error handling pattern.

Add comprehensive test suite covering valid responses, unparseable
status lines, and edge cases.

Actions

  • Squashed 3 commits into 1
  • Force-pushed koan.toddr.bot/curl-unparseable-status-exception to origin
  • Updated PR title
  • Updated PR description

Automated by Koan

@toddr toddr marked this pull request as ready for review April 6, 2026 01:32
@toddr toddr merged commit ab8fae7 into main Apr 6, 2026
18 checks passed
@toddr toddr deleted the koan.toddr.bot/curl-unparseable-status-exception branch April 6, 2026 01:32
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.

2 participants