Commits

Anonymous committed 0b15e21

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

  • Participants
  • Parent commits 3fe394e

Comments (0)

Files changed (2)

File piston/resource.py

         try:
             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)
         message.send(fail_silently=True)
 
 
-    def error_handler(self, e, request):
+    def error_handler(self, e, request, meth):
         """
         Override this method to add handling of errors customized for your 
         needs

File piston/tests.py

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