Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't treat some HTTP status error codes as not errors #78

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

SeanTAllen
Copy link
Contributor

Previously 401, 403, 503, 504, and 999 HTTP status codes were treated as "not an error" and therefore not reported. At the time this made sense as there was no easy way to say "do not treat 504 codes as an error, I will assume it is transient". However, with a recent change you can do:

raise_error_excludes:
        504: ['*']

And treat all 504s as not an error.

This commit makes all "special HTTP status codes" an error and allows for users to configure their raise_error_excludes if they want to get the old behavior back.

I found this functionality when trying to figure out why some links that we had that there bad weren't being reported by htmlproofer. It turned out that the broken links were coming back with "probably good" error codes and thus we never saw them.

Closes #77

Previously 401, 403, 503, 504, and 999 HTTP status codes were
treated as "not an error" and therefore not reported. At the time
this made sense as there was no easy way to say "do not treat 504
codes as an error, I will assume it is transient". However, with a
recent change you can do:

```yml
raise_error_excludes:
        504: ['*']
```

And treat all 504s as not an error.

This commit makes all "special HTTP status codes" an error and allows
for users to configure their `raise_error_excludes` if they want to
get the old behavior back.

I found this functionality when trying to figure out why some links
that we had that there bad weren't being reported by htmlproofer. It
turned out that the broken links were coming back with "probably good"
error codes and thus we never saw them.

Closes manuzhang#77
@manuzhang manuzhang merged commit ed60f7c into manuzhang:main Mar 3, 2024
9 checks passed
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.

Don't hardcode not reporting 503, 504, and 999 errors
2 participants