Skip to content

Humanize HTTP errors and update tests#1

Merged
venelinkochev merged 1 commit into
mainfrom
update/probe-errors
Apr 16, 2026
Merged

Humanize HTTP errors and update tests#1
venelinkochev merged 1 commit into
mainfrom
update/probe-errors

Conversation

@venelinkochev

Copy link
Copy Markdown
Contributor

Add humanizeHTTPError to convert raw Go HTTP errors into concise, user-friendly messages (handles timeouts, DNS failures, TLS/certificate issues, connection errors, redirect loops, and unwraps url.Error). Update HTTPChecker.Check to use this function and change status formatting to "HTTP ". Add helper functions formatDuration and trimAfter. Update tests: adjust timeout assertion to expect a "timed out" message and add tests for DNS not found and connection-refused scenarios.

Add humanizeHTTPError to convert raw Go HTTP errors into concise, user-friendly messages (handles timeouts, DNS failures, TLS/certificate issues, connection errors, redirect loops, and unwraps url.Error). Update HTTPChecker.Check to use this function and change status formatting to "HTTP <code> <text>". Add helper functions formatDuration and trimAfter. Update tests: adjust timeout assertion to expect a "timed out" message and add tests for DNS not found and connection-refused scenarios.
@venelinkochev venelinkochev merged commit 10d8631 into main Apr 16, 2026
@venelinkochev venelinkochev deleted the update/probe-errors branch April 16, 2026 11:40
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