'Returns status message
returns a string made out of code and status if present, else message'

def _get_code_and_status_or_message(self, exception):

    if ((getattr(exception, 'code', None) is not None) and (getattr(exception, 'status', None) is not None)):
        return ("Status:    '%s',    Code:    %s" % (exception.status, exception.code))
    return six.text_type(exception)
