Commits

Ionel Cristian Mărieș  committed ad479ae

Fixed Resource.error_handler to include em_format.

  • Participants
  • Parent commits 882d384

Comments (0)

Files changed (2)

File piston/resource.py

         try:
             result = meth(request, *args, **kwargs)
         except Exception, e:
-            result = self.error_handler(e, request, meth)
+            result = self.error_handler(e, request, meth, em_format)
 
 
         try:
         message.send(fail_silently=True)
 
 
-    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 
         needs

File piston/tests.py

                 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