1. Jesper Nøhr
  2. django-piston
Issue #223 new

Doesn't return regarding error's output

Orcun Avsar
created an issue

Instead of traceback that my handler produces, It returns following traceback which makes debugging from client-side not possible:

{{{ File "/path_to_myproject/django/core/servers/basehttp.py", line 284, in run self.finish_response()

File "/path_to_myproject/django/core/servers/basehttp.py", line 323, in finish_response for data in self.result:

File "/path_to_myproject/django/http/init.py", line 609, in next chunk = self._iterator.next()

File "/path_to_myproject/piston/emitters.py", line 340, in stream_render yield self.render(request)

File "/path_to_myproject/piston/emitters.py", line 410, in render seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)

File "/path_to_myproject/piston/emitters.py", line 319, in construct return _any(self.data, self.fields)

File "/path_to_myproject/piston/emitters.py", line 125, in _any raise HttpStatusCode(thing)

HttpStatusCode

}}}

I've read the code of piston and after making attached change it gave the correct exception and traceback output (which was a CassandraConnectionError).

I'm not sure this error can be reproduced in somehow, because It's such a noisy problem but not reported by any other so far.

About the attached diff, why don't you return formatted error output immediately after error_handler returns it?

Comments (0)

  1. Log in to comment