def METHOD_NAME(self, response):
    try:
        data = response.json()
    except ValueError as error:
        log.warning('Failed to extract token: {msg}'.format(msg=error))
    else:
        self.token = data['token']
    finally:
        return response