Skip to content

Commit dcb774a

Browse files
committed
more coderabbit
1 parent 90f4f85 commit dcb774a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

packages/sdk/src/server/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ export class BackendClient extends BaseClient {
313313
}
314314
parameters.set("project_id", this.projectId);
315315
parameters.set("environment", this.environment);
316-
317316
try {
318317
const response = await oauth.clientCredentialsGrantRequest(as, client, clientAuth, parameters);
319318
const oauthTokenResponse = await oauth.processClientCredentialsResponse(as, client, response);
@@ -327,7 +326,6 @@ export class BackendClient extends BaseClient {
327326
let errorMessage = "OAuth token request failed";
328327
let wwwAuthenticate: string | undefined;
329328
let statusCode: number | undefined;
330-
331329
if (e instanceof Error) {
332330
errorMessage = e.message;
333331
}
@@ -338,7 +336,6 @@ export class BackendClient extends BaseClient {
338336
statusCode = errorResponse.status;
339337
wwwAuthenticate = errorResponse.headers?.get?.("www-authenticate") ||
340338
errorResponse.headers?.["www-authenticate"];
341-
342339
// Create more specific error message based on status code
343340
if (statusCode === 401) {
344341
errorMessage = `OAuth authentication failed (401 Unauthorized)${wwwAuthenticate ? `: ${wwwAuthenticate}` : ""}`;
@@ -349,11 +346,9 @@ export class BackendClient extends BaseClient {
349346
}
350347
}
351348
}
352-
353349
const error = new Error(errorMessage);
354350
(error as any).statusCode = statusCode;
355351
(error as any).wwwAuthenticate = wwwAuthenticate;
356-
357352
// If this is the last attempt, throw the error
358353
if (attempts >= maxAttempts) {
359354
throw error;

0 commit comments

Comments
 (0)