1. Ryszard Szopa
  2. django-piston


Matt Cordes  committed 0b15e21

updated error_handler method to take meth parameter (fixing a crash when a type error occurs)

  • Participants
  • Parent commits 3fe394e
  • Branches default

Comments (0)

Files changed (2)

File piston/resource.py

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

File piston/tests.py

View file
             Handler which raises a custom exception 
+            allowed_methods = ('GET',)
             def read(self, request):
                 raise GoAwayError('Jerome', 'No one likes you')