Skip to content

Commit 99074f8

Browse files
committed
fix: response text
1 parent 7d64982 commit 99074f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/atlas/apiClient.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ export class ApiClient {
6262
private errorMiddleware = (): Middleware => ({
6363
async onResponse({ response }) {
6464
if (!response.ok) {
65-
throw new ApiClientError(`Error calling Atlas API: ${await response.text()}`, response);
65+
try {
66+
const text = await response.text();
67+
throw new ApiClientError(`Error calling Atlas API: [${response.statusText}] ${text}`, response);
68+
}
69+
catch {
70+
throw new ApiClientError(`Error calling Atlas API: ${response.statusText}`, response);
71+
}
6672
}
6773
},
6874
});

0 commit comments

Comments
 (0)