Exemple #1
0
        def wrapper(*args, **kwargs):
            response = f(*args, **kwargs)

            if response.status_code == 429:
                raise TenableIORetryableApiException(response)
            if response.status_code in [501, 502, 503, 504]:
                raise TenableIORetryableApiException(response)
            if not 200 <= response.status_code <= 299:
                raise TenableIOApiException(response)

            return response
Exemple #2
0
 def wrapper(*args, **kwargs):
     response = f(*args, **kwargs)
     if response.status_code in TenableIOClient._RETRY_STATUS_CODES:
         raise TenableIORetryableApiException(response)
     if not 200 <= response.status_code <= 299:
         raise TenableIOApiException(response)
     return response