diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4bf7d902..d68a96d3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1 @@ * @mongodb-js/mcp-server-developers -**/atlas @blva @fmenezes -**/mongodb @nirinchev @gagik diff --git a/src/common/atlas/apiClientError.ts b/src/common/atlas/apiClientError.ts index c445d4d4..baea7b57 100644 --- a/src/common/atlas/apiClientError.ts +++ b/src/common/atlas/apiClientError.ts @@ -3,6 +3,7 @@ import { ApiError } from "./openapi.js"; export class ApiClientError extends Error { private constructor( message: string, + public readonly response: Response, public readonly apiError?: ApiError ) { super(message); @@ -27,7 +28,11 @@ export class ApiClientError extends Error { const apiError = typeof error === "object" && !(error instanceof Error) ? error : undefined; - return new ApiClientError(`[${response.status} ${response.statusText}] ${message}: ${errorMessage}`, apiError); + return new ApiClientError( + `[${response.status} ${response.statusText}] ${message}: ${errorMessage}`, + response, + apiError + ); } private static async extractError(response: Response): Promise {