Handle some errors from the captcha generator. #378
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main case here is where we handle HTTPGone. The vast majority of our
production tracebacks are from here where (somehow) people are loading forms
that generate captchas (which works) and then way later, they are requesting
those same captcha images again (over 300 seconds later.. that's like 5
minutes). I bet this is happening if someone has a bodhi update page open,
and then their browser crashes and tries to restore its previous state, or
something like that.
Anyways, this patch adds a catch to that main "captcha is expired"
InvalidToken
traceback that is spamming our logs. It turns it into a 410Gone statuscode, which makes sense. While testing it, I tried passing in
garbage which generated a different
TypeError
from the base64 module, so Icaught that too.
Fixes #237.