-
Notifications
You must be signed in to change notification settings - Fork 46
[bug 1136840] Fix error handling for better debugging: WIP #509
Conversation
Since I added However The tests don't kick up any exceptions, so there's nothing going through that new section of code at the moment. I think I can fix that by creating a view that errors out and then triggering it and then testing the Accept logic. Anyhow, this is a WIP. I'm curious to see if the approach is daft or not. I also want to see if it passes Travis tests. |
^^^ That fixes I tried to add a test that verifies the Accept handling, but it appears the tests are using a different WSGI mechanism. I might be able to do this with a LiveServerTestCase, but that seems like a lot of trouble. It's easy to test manually.
|
^^^ That cleans some things up and reduces some of the differences. |
I spent some time trying to get LiveServerTestCase working, but it refuses to be ok with |
For the record, I don't like parts of this PR, but can't figure out better ways to do them and I need this (or something equivalent that lets me see POST payloads) asap so I can fix HB issues. |
|
||
if newrelic: | ||
application = newrelic.agent.wsgi_application()(application) | ||
|
||
# vim: ft=python |
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.
why you hating on vim? </troll>
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.
I've been removing these emacs/vim metadata things where I see them.
Slightly related, it would be cool if that error page was CSRF exempt... So I could do this |
I can make that view csrf-exempt. That's a good idea. |
cool. Time to try it on stage? |
^^^ Added the |
I see |
Ok. After Travis gives me the green light, I'll squish everything down, double-check the code, push it to upstream in a branch and test it out on stage. |
^ Squashed commits and redid the commit message. I'm pushing this to stage to test it out now. |
I pushed it to stage and tested it out. I tried a few "bad post data" attempts, too, and they all seem fine. |
I mostly just moved some things around so they're in places that are more logical.
* creates DebuggableWSGIHandler which should send more useful error emails so I can debug API-related problems, plus in DEBUG=True mode, it'll return plain formatted content rather than html formatted content; plain text is a lot easier to read in a terminal when debugging API-related problems * created fjord/wsgi.py which gets used by "./manage.py runserver" and holds common WSGI setup for fjord * adjusts wsgi/playdoh.wsgi which gets used by stage/prod environments to do stage/prod specific things and then use fjord/wsgi.py for the rest
[bug 1136840] Fix error handling for better debugging: WIP
Landed in ceb53eb [bug 1136840] Fix error handling for better debugging Thank you! |
emails so I can debug API-related problems, plus in DEBUG=True
mode, it'll return text/plain content rather than text/html content
which is a lot easier to read in a terminal when debugging API-related
problems
have to get the servers fixed to use this instead of wsgi/playdoh.wsgi
if this works
former is used in production and the latter is used in development,
but should be used in production
r?