We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84d70ef commit 4a0db37Copy full SHA for 4a0db37
src/common/atlas/apiClientError.ts
@@ -18,14 +18,14 @@ export class ApiClientError extends Error {
18
return this.fromError(response, err, message);
19
}
20
21
- private static fromError(
+ static fromError(
22
response: Response,
23
error?: ApiError | string | Error,
24
message: string = `error calling Atlas API`
25
): ApiClientError {
26
const errorMessage = this.buildErrorMessage(error);
27
28
- const apiError = typeof error === "object" ? error : undefined;
+ const apiError = typeof error === "object" && !(error instanceof Error) ? error : undefined;
29
30
return new ApiClientError(`[${response.status} ${response.statusText}] ${message}: ${errorMessage}`, apiError);
31
0 commit comments