Logging when GPT's Zero response != 200

This commit is contained in:
Carlos Mesquita
2024-07-25 17:11:14 +01:00
parent eb904f836a
commit 34afb5d1e8

View File

@@ -25,6 +25,7 @@ class GPTZero:
}
response = requests.post(self._GPT_ZERO_ENDPOINT, headers=self._header, json=data)
if response.status_code != 200:
self._logger.error(f'GPT\'s Zero Endpoint returned with {response.status_code}: {response.json()}')
return None
return self._parse_detection(response.json())