I've implemented a simple POST handler for uploading a file using Django Piston. I'm testing with manage.py runserver. When my handler throws an exception, I get an error in the console: "[Errno 32] Broken pipe". The traceback is somewhere is the Python socket server code. Obviously the exception is causing the pipe to be broken and that is the error that shows up in the console.
Is there an easy way to get the actual exception and traceback in my handler to be logged? Otherwise hunting down the problem is really difficult.
I figured this one out myself. It was my mistake since I was using "curl -f" to make my request, so curl doesn't read the response from the server but cuts the pipe instead and returns an error to the shell.
Could happen to someone else though so I renamed the question to make it clearer what was going on.