Skip to content

Commit 8d282c1

Browse files
author
Hongbin Huang
committed
fix: sync from main - when async api fail, raise the right error message
1 parent a94ebaa commit 8d282c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

easyai/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ def _extract_result(self, json_result):
100100

101101
def _to_api_result(self, response):
102102
if response.status_code != 200:
103-
raise RuntimeError(response.status_code, response.text)
103+
raise RuntimeError(response.status_code, response.text())
104104

105105
r = response.json()
106106
return self._extract_result(r)
107107

108108
async def _to_api_result_async(self, response):
109109
if response.status != 200:
110-
raise RuntimeError(response.status, await response.text)
110+
raise RuntimeError(response.status, await response.text())
111111

112112
r = await response.json()
113113
return self._extract_result(r)

0 commit comments

Comments
 (0)