def _raise_for_status(response):
    status = response.status_code
    if 400 <= response.status_code < 500:
        try:
            body = response.json()
            response.reason = body['errorMessage']
            return response.raise_for_status()
        except (__HOLE__, ValueError):
            pass

        try:
            response.reason = PEBBLE_CODES[status]
            return response.raise_for_status()
        except KeyError:
            pass

    response.raise_for_status()
dataset/ETHPy150Open MarSoft/PebbleNotes/gae/pypebbleapi.repo/pypebbleapi/timeline.py/_raise_for_status