When a nonformatted request is made, currently the only text in the
response is the (probably empty) response buffer. Add the statusmsg
as well, where the error is likely to be explained. This lets
the http client get a clue what happened.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
{1}
</status>
</response>'''.format(response, xml.sax.saxutils.escape(statusmsg))
+ else:
+ if 200 <= errorcode < 300:
+ response = response + '\n' + statusmsg + '\n'
return flask.make_response(response, errorcode)