Piston Swallows TypeErrors

Issue #196 on hold
Ian Lewis
created an issue

Piston Swallows all TypeErrors that might happen in your application and assumes they must be form validation or url signature errors.

This makes debugging extremely difficult and annoying as you will get back a 400 error for a random type error instead of a stack trace.

Comments (2)

  1. Joshua Ginsberg

    I appreciate the bug report, but it would be helpful if you could provide sample code demonstrating the effect you're seeing. I'll put this on-hold pending an elaboration of the description - if none is provided, I will mark it invalid. Thanks!

  2. Ian Lewis reporter


    The code below calls a function with the wrong arguments but piston thinks it's my handler that's being called with the wrong arguments or it's a validation error and swallows it and returns a 400 instead of a 500 and a proper crash report. While coding if I make a coding mistake that causes a TypeError or any subclass to be raised then piston swallows it and I have to use pdb or some other method to figure out what the error is.

    from piston.handler import BaseHandler
    class MyHandler(BaseHandler):
        def read(self, request):
            return HttpResponse("")
    def somefunc(xxx):
        return xxx
  3. Log in to comment