1. Mike O'Toole
  2. django-piston


Ionel Cristian Mărieș  committed ad479ae

Fixed Resource.error_handler to include em_format.

  • Participants
  • Parent commits 882d384
  • Branches default

Comments (0)

Files changed (2)

File piston/resource.py

View file
  • Ignore whitespace
             result = meth(request, *args, **kwargs)
         except Exception, e:
-            result = self.error_handler(e, request, meth)
+            result = self.error_handler(e, request, meth, em_format)
-    def error_handler(self, e, request, meth):
+    def error_handler(self, e, request, meth, em_format):
         Override this method to add handling of errors customized for your 

File piston/tests.py

View file
  • Ignore whitespace
                 raise GoAwayError('Jerome', 'No one likes you')
         class MyResource(Resource):
-            def error_handler(self, error, request, meth):
+            def error_handler(self, error, request, meth, em_format):
                 # if the exception is our exeption then generate a 
                 # custom response with embedded content that will be 
                 # formatted as json