<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _fail(response):
 """ Raise an ApiFailure pertaining to the given response """

        message = "Status code: {}-{}, url: {}".format(response.status_code, response.reason, response.url)
        try:
            message += ", message:{}".format(response.json()["message"])
        except (ValueError, KeyError):
            pass
        raise ApiFailure(message, response.status_code)