def analyze_error(self, exc):
        error = exc.data
        try:
            error = json.loads(error)
            code = int(error['status']['status_code'])
            message = error['status']['message']
        except (KeyError, __HOLE__):
            code = exc.status
            message = error
        if code == 401:
            if message == "Access Token Validation Failed":
                raise AuthError(message)
            elif message == 'Invalid Signature':
                raise InvalidSignature(message)
            elif message == 'Invalid Or Expired Token':
                raise InvalidOrExpiredToken(message)
        elif code == 403:
                if 'Service is over queries per second limit' in message:
                    raise TooManyRequestsPerSecondError()
                elif 'Over queries per day limit' in message:
                    raise TooManyRequestsPerDayError()
        elif code == 404:
            raise NotFound(message)
        elif code == 400 and message == 'Missing Required Access Token':
            raise MissingAccessTokenError(message)
        elif code == 412 and message == 'Title is already in queue':
            raise TitleAlreadyInQueue()
        elif code >= 500:
            raise InternalNetflixError(message)


        raise NetflixError(code, message)
dataset/ETHPy150Open ryszard/python-netflix/netflix/__init__.py/Netflix.analyze_error