diff roundup/rest.py @ 5984:25a813415d59

issue2551069 - when unsupported type is found report type When reporting an unsupported response type, error 406, report what type is seen by the code. Allows the user to better debug the query. E.G. look at the url and see if they mistyped it (e.g. by leaving a ? out of the url), or a mispelled accept header value or ....
author John Rouillard <rouilj@ieee.org>
date Tue, 26 Nov 2019 09:55:09 -0500
parents 5d0873a4de4a
children ea3485c67f94
line wrap: on
line diff
--- a/roundup/rest.py	Sat Nov 23 15:18:02 2019 -0500
+++ b/roundup/rest.py	Tue Nov 26 09:55:09 2019 -0500
@@ -1985,8 +1985,8 @@
             # error out before doing any work if we can't
             # display acceptable output.
             self.client.response_code = 406
-            output = ( "Requested content type is not available.\n"
-                       "Acceptable types: %s"%(
+            output = ( "Requested content type '%s' is not available.\n"
+                       "Acceptable types: %s"%(data_type,
                            ", ".join(self.__accepted_content_type.keys())))
 
         # Make output json end in a newline to

Roundup Issue Tracker: http://roundup-tracker.org/