Skip to content

Commit

Permalink
[Fix] Change Empty Response to Internal Server Error for originalityai
Browse files Browse the repository at this point in the history
  • Loading branch information
coscialp committed Nov 6, 2023
1 parent 67c9975 commit 77ae6f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions edenai_apis/apis/originalityai/originalityai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def text__plagia_detection(
try:
original_response = response.json()
except json.JSONDecodeError as exc:
print(response.status_code)
print(response.text)
raise ProviderException(
message="Empty response", code=response.status_code
message="Internal Server Error", code=response.status_code
) from exc

if response.status_code != HTTPStatus.OK:
Expand Down Expand Up @@ -100,7 +102,7 @@ def text__ai_detection(self, text: str) -> ResponseType[AiDetectionDataClass]:
original_response = response.json()
except json.JSONDecodeError as exc:
raise ProviderException(
message="Empty response", code=response.status_code
message="Internal Server Error", code=response.status_code
) from exc

if response.status_code != 200:
Expand Down

0 comments on commit 77ae6f6

Please sign in to comment.