)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"720663e3777e90094c8553e5c52758884a5cd579","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Handle API error for XML client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When there was an error from the API server, the error did not"},{"line_number":10,"context_line":"get shown on the bowser. A general message like \"A server error"},{"line_number":11,"context_line":"occurred. Please contact the administrator.\" was shown instead."},{"line_number":12,"context_line":"This patch fixes it by showing the exact response from the API"},{"line_number":13,"context_line":"server."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAXH%2F%2FMhw%3D","line":10,"updated":"2014-04-23 12:22:29.000000000","message":"s/bowser/browser/","commit_id":"d5383102a503420d226d5634acf13f92d7e34ab0"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"11f9f7d1267ad91d23fafe6513421aca29f0839f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Handle API error for XML client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When there was an error from the API server, the error did not"},{"line_number":10,"context_line":"get shown on the bowser. A general message like \"A server error"},{"line_number":11,"context_line":"occurred. Please contact the administrator.\" was shown instead."},{"line_number":12,"context_line":"This patch fixes it by showing the exact response from the API"},{"line_number":13,"context_line":"server."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAXX%2F%2F%2FqI%3D","line":10,"in_reply_to":"AAAAXH%2F%2FMhw%3D","updated":"2014-04-24 20:27:38.000000000","message":"Done. Thanks for the catch.","commit_id":"d5383102a503420d226d5634acf13f92d7e34ab0"}],"ironic/api/hooks.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"de3ad610702e72a2485028aa9468f5027c51008e","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":"from pecan import hooks"},{"line_number":21,"context_line":"from simplejson import scanner"},{"line_number":22,"context_line":"from webob import exc"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from ironic.common import context"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fq6A%3D","line":21,"updated":"2014-04-18 11:32:59.000000000","message":"Was this import missing previously? I don\u0027t see your code using it","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"53a1d3743b17c66b63a1542615faad27e2581820","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":"from pecan import hooks"},{"line_number":21,"context_line":"from simplejson import scanner"},{"line_number":22,"context_line":"from webob import exc"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from ironic.common import context"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FqxQ%3D","line":21,"in_reply_to":"AAAAXH%2F%2Fq5M%3D","updated":"2014-04-18 11:58:13.000000000","message":"Oh my, I need more coffee today Oo","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b9cd4dab0ef830dc32563f8428cafd9896d4d7d7","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":"from pecan import hooks"},{"line_number":21,"context_line":"from simplejson import scanner"},{"line_number":22,"context_line":"from webob import exc"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from ironic.common import context"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fq5M%3D","line":21,"in_reply_to":"AAAAXH%2F%2Fq6A%3D","updated":"2014-04-18 11:38:57.000000000","message":"? It\u0027s being used yes\n\nL136 except scanner.JSONDecodeError:","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"e28d7745c9803c042fdba3373c7e21394617bcdc","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":"from pecan import hooks"},{"line_number":21,"context_line":"from simplejson import scanner"},{"line_number":22,"context_line":"from webob import exc"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from ironic.common import context"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fnso%3D","line":21,"in_reply_to":"AAAAXH%2F%2FqxQ%3D","updated":"2014-04-18 19:16:42.000000000","message":"okay, okay, easy guys :-).  I removed it. Now I use a different way to detect if it is xml or not.","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"073feb9fd3e0d3b44e468630953daeedd28465d6","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            json_body \u003d state.response.json"},{"line_number":136,"context_line":"        except scanner.JSONDecodeError:"},{"line_number":137,"context_line":"            # this is the case with xml output"},{"line_number":138,"context_line":"            return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Do not remove traceback when server in debug mode (except \u0027Server\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FtRs%3D","line":137,"updated":"2014-04-18 02:43:29.000000000","message":"Can we assume all the JSONDecodeError is for xml output?Maybe we have more case for same exception here.","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"e28d7745c9803c042fdba3373c7e21394617bcdc","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            json_body \u003d state.response.json"},{"line_number":136,"context_line":"        except scanner.JSONDecodeError:"},{"line_number":137,"context_line":"            # this is the case with xml output"},{"line_number":138,"context_line":"            return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Do not remove traceback when server in debug mode (except \u0027Server\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FnsU%3D","line":137,"in_reply_to":"AAAAXH%2F%2Fq4A%3D","updated":"2014-04-18 19:16:42.000000000","message":"Done","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b9cd4dab0ef830dc32563f8428cafd9896d4d7d7","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            json_body \u003d state.response.json"},{"line_number":136,"context_line":"        except scanner.JSONDecodeError:"},{"line_number":137,"context_line":"            # this is the case with xml output"},{"line_number":138,"context_line":"            return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Do not remove traceback when server in debug mode (except \u0027Server\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fq4A%3D","line":137,"in_reply_to":"AAAAXH%2F%2Fq6I%3D","updated":"2014-04-18 11:38:57.000000000","message":"I agree with the comments here, I think that we first we need to identify whether it\u0027s xml or not, and not hide the JSONDecode error","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"de3ad610702e72a2485028aa9468f5027c51008e","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        try:"},{"line_number":135,"context_line":"            json_body \u003d state.response.json"},{"line_number":136,"context_line":"        except scanner.JSONDecodeError:"},{"line_number":137,"context_line":"            # this is the case with xml output"},{"line_number":138,"context_line":"            return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Do not remove traceback when server in debug mode (except \u0027Server\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2Fq6I%3D","line":137,"in_reply_to":"AAAAXH%2F%2FtRs%3D","updated":"2014-04-18 11:32:59.000000000","message":"I also object. You can start with catching JSONDecodeError, but then please at least check for \u003c?xml in text :) otherwise unexpected JSONDecodeError should probably be logged with high urgency","commit_id":"de6426dcf1ad5b2c732392e8907444603b15f5c1"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"720663e3777e90094c8553e5c52758884a5cd579","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        headers \u003d state.response.headers"},{"line_number":134,"context_line":"        if headers and \u0027/xml\u0027 in headers.get(\u0027Content-Type\u0027):"},{"line_number":135,"context_line":"            # this is the case with xml error"},{"line_number":136,"context_line":"            return"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FMg4%3D","line":134,"updated":"2014-04-23 12:22:29.000000000","message":"I am not sure myself, can we possibly have None as a result of headers.get?","commit_id":"d5383102a503420d226d5634acf13f92d7e34ab0"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"11f9f7d1267ad91d23fafe6513421aca29f0839f","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        headers \u003d state.response.headers"},{"line_number":134,"context_line":"        if headers and \u0027/xml\u0027 in headers.get(\u0027Content-Type\u0027):"},{"line_number":135,"context_line":"            # this is the case with xml error"},{"line_number":136,"context_line":"            return"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXX%2F%2F%2FqA%3D","line":134,"in_reply_to":"AAAAXH%2F%2FMg4%3D","updated":"2014-04-24 20:27:38.000000000","message":"Yeah, I\u0027d better guard it. Thanks. \nDone.","commit_id":"d5383102a503420d226d5634acf13f92d7e34ab0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"953f4c40379b7e46758195b3037496ba5aca172a","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        headers \u003d state.response.headers"},{"line_number":135,"context_line":"        if headers:"},{"line_number":136,"context_line":"            content_type \u003d headers.get(\u0027Content-Type\u0027)"},{"line_number":137,"context_line":"            if content_type and \u0027/xml\u0027 in content_type:"},{"line_number":138,"context_line":"                return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        json_body \u003d state.response.json"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXX%2F%2FwR8%3D","line":137,"updated":"2014-04-28 08:20:43.000000000","message":"If the Content-type header is not specified, the API service looks to the URI: if it ends with .xml, the XML API will be used.","commit_id":"79d519487a611f115a1c342eed6b58009bb1e9b2"},{"author":{"_account_id":7589,"name":"linggao","email":"linggao@us.ibm.com","username":"linggao"},"change_message_id":"3412f8de9051da295dbba3613fc205e469284d25","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        headers \u003d state.response.headers"},{"line_number":135,"context_line":"        if headers:"},{"line_number":136,"context_line":"            content_type \u003d headers.get(\u0027Content-Type\u0027)"},{"line_number":137,"context_line":"            if content_type and \u0027/xml\u0027 in content_type:"},{"line_number":138,"context_line":"                return"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        json_body \u003d state.response.json"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_e43a9935","line":137,"in_reply_to":"AAAAXX%2F%2FwR8%3D","updated":"2014-04-30 20:13:31.000000000","message":"Roman, the code here is checking the response header, not the request header.  In the case you have described, does the /xml be put into the response header?","commit_id":"79d519487a611f115a1c342eed6b58009bb1e9b2"}]}
