Skip to content

Commit 65e3cc4

Browse files
committed
fix: 500 error handling
1 parent a0d1674 commit 65e3cc4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sdk/diffgram/core/core.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,13 @@ def handle_errors(self,
265265
"Rate Limited. Please add buffer between calls eg time.sleep(1). Otherwise, please try again later. Else contact us if this persists.")
266266

267267
if response.status_code == 500:
268-
raise Exception("Internal error, please try again later.")
269-
268+
try:
269+
raise Exception(response.json()["log"]["error"])
270+
except:
271+
try:
272+
raise Exception(f"Internal error [500] {response.text}")
273+
except:
274+
raise Exception(f"Internal server error: {response}")
270275
raise_for_status = response.raise_for_status()
271276
if raise_for_status:
272277
Exception(raise_for_status)

0 commit comments

Comments
 (0)