Commits

Mike O'Toole  committed ae58f19

preventing TypeErrors from being swallowed

  • Participants
  • Parent commits 1de66e0
  • Branches nestio

Comments (0)

Files changed (1)

File piston/resource.py

         """
         if isinstance(e, FormValidationError):
             return self.form_validation_response(e)
+        
+        # this swallows all type errors!
+        # elif isinstance(e, TypeError):
+        #     result = rc.BAD_REQUEST
+        #     hm = HandlerMethod(meth)
+        #     sig = hm.signature
 
-        elif isinstance(e, TypeError):
-            result = rc.BAD_REQUEST
-            hm = HandlerMethod(meth)
-            sig = hm.signature
+        #     msg = 'Method signature does not match.\n\n'
 
-            msg = 'Method signature does not match.\n\n'
+        #     if sig:
+        #         msg += 'Signature should be: %s' % sig
+        #     else:
+        #         msg += 'Resource does not expect any parameters.'
 
-            if sig:
-                msg += 'Signature should be: %s' % sig
-            else:
-                msg += 'Resource does not expect any parameters.'
+        #     if self.display_errors:
+        #         msg += '\n\nException was: %s' % str(e)
 
-            if self.display_errors:
-                msg += '\n\nException was: %s' % str(e)
-
-            result.content = format_error(msg)
-            return result
+        #     result.content = format_error(msg)
+        #     return result
         elif isinstance(e, Http404):
             return rc.NOT_FOUND