Commits

Anonymous committed 04d0f8c

Added error handling for invalid emitter format.

  • Participants
  • Parent commits 99afb3c

Comments (0)

Files changed (1)

piston/resource.py

             """
             return self.handle_exception(request, e, sys.exc_info(), em_format)
 
-        emitter, ct = Emitter.get(em_format)
+        try:
+            emitter, ct = Emitter.get(em_format)
+        except ValueError:
+            result = rc.BAD_REQUEST
+            result.content = "Invalid output format specified '%s'." % em_format
+            return result
+
         try:
             result, fields = result
         except ValueError: