-
Notifications
You must be signed in to change notification settings - Fork 4
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
(chore): add error string to handle_snapshot #163
Conversation
Prior to this change debugging the handle_snapshot function was difficult, because no error message beyond "INTERNAL SERVER ERROR" was returned. After this change, the exception's message is returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is a nice usability improvement. I think we can implement this generally in a middleware rather than just for this one endpoint.
Here's an example middleware that we already have
dd-apm-test-agent/ddapm_test_agent/agent.py
Lines 99 to 107 in e0eb48d
@middleware | |
async def session_token_middleware(request: Request, handler: _Handler) -> web.Response: | |
"""Extract session token from the request and store it in the request. | |
The token is retrieved from the headers or params of the request. | |
""" | |
token = _session_token(request) | |
request["session_token"] = token | |
return await handler(request) |
Could you check to see if we could do that approach so we have this for all endpoints, @tabgok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Prior to this change debugging the handle_snapshot function was difficult, because no error message beyond "INTERNAL SERVER ERROR" was returned. After this change, the exception's message is returned.