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 log stack trace when client has gone away during media download #4738

Merged
merged 3 commits into from Feb 25, 2019
Merged
Changes from 2 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+10 −2
Diff settings

Always

Just for now

Copy path View file
@@ -0,0 +1 @@
Cleanup request exception logging

This comment has been minimized.

Copy link
@richvdh

richvdh Feb 25, 2019

Member

full-stop?

This comment has been minimized.

Copy link
@erikjohnston

erikjohnston Feb 25, 2019

Author Member

nyargh

Copy path View file
@@ -133,8 +133,15 @@ def respond_with_responder(request, responder, media_type, file_size, upload_nam

logger.debug("Responding to media request with responder %s")
add_file_headers(request, media_type, file_size, upload_name)
with responder:
yield responder.write_to_consumer(request)
try:
with responder:
yield responder.write_to_consumer(request)
except Exception as e:
# The majority of the time this will be due to the client having gone
# away. Unfortunately, Twisted simply throws a generic exception at us
# in that case.
logger.warning("Failed to write to consumer: %s %s", type(e), e)

finish_request(request)


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.