(response, message=None, error=RuntimeError)
Raise an error using error message extracted from response.
Raise an error using error message extracted from response.
Raise an error using error message extracted from response .
def error_message(response, message=None, error=RuntimeError):
    """Raise an error using error message extracted from response."""
    if not message:
        message = 'Unknown error, with error: '
    text = _get_message(response)

    raise error('{0:s}, with error [{1:d}] {2:s} {3:s}'.format(
        message, response.status_code, _get_reason(response), text))
def error_message ( response , message = None , error = RuntimeError ) : if not message : message = 'Unknown error, with error: ' text = _get_message ( response ) raise error ( '{0:s}, with error [{1:d}] {2:s} {3:s}' . format ( message , response . status_code , _get_reason ( response ) , text ) )