-
Notifications
You must be signed in to change notification settings - Fork 30
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
Configurable HTTP Error Handling #12
Comments
We use the link checker as part of our CI builds. Some sites are down every once in a while. They are down for several hours and return a 503 code during that time. And our builds fail. Would appreciate if you could comment whether this is a feature you would consider and in case you do at what time frame. |
If a website will spuriously go down, is it even worth trying to check links that go to it?
Setting it to warnings only probably won't do anything. Warnings are for edge cases where the link could be broken, but it could also be a false negative. For example, if you wrote something that looks like a link (such as The actual code that translates the
We might need to think about a good policy for deciding what is an error and what isn't, but I like the idea of improving the way we detect errors! Instead of evolving organically and adding For example, maybe by specifying a list of rules that match on status codes, where earlier rules take precedence? [output.linkcheck.http-error-handling]
# specific rules
"200" = "OK"
"429" = "Warn"
"503" = "Warn"
# catch-all
"400-499" = "AlwaysFail"
"500-599" = "AlwaysFail" |
Short answer is yes. We link to pages from http://www.omg.org . These are down for up to three hours every couple of weeks. Other than that the links are fine (also one time Amazon US was down for a couple of hours. That was truly an outlier, but I just had to take a screenshot).
Thanks for clarifying that.
Sounds great. Will also give other users more flexibility. PS: I would love to contribute PRs not just an upvote on an issue, but I haven't written a single line of Rust yet. It's on my list of languages I want to learn, but might be a while before I can do something useful with it. |
We might want to add some sort of
http-error-behaviour
option to the config which lets you select how to handle HTTP errors. Some possible strategies are:AlwaysFail
- translates all non-2XX status codes to a failureWarn
- translates all non-2XX status codes to a warningWarnOnServerError
- translates status codes which indicate there was a spurious server failure to warnings. All other non-2XX status codes are errors.Original comment from rust-lang/rustc-dev-guide#388 (comment):
The text was updated successfully, but these errors were encountered: