From dee5a5edefd2c15278389fda9bd580b0c88f58d0 Mon Sep 17 00:00:00 2001 From: Naoki Ainoya Date: Wed, 2 Jul 2025 09:47:42 +0900 Subject: [PATCH] fix lint --- src/main.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index cc38567..8477d5c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -85,24 +85,26 @@ export async function run(): Promise { // Extract x-ms-error-code from headers if available const errorCode = response.headers['x-ms-error-code'] const errorCodeMsg = errorCode ? ` (error code: ${errorCode})` : '' - + // Check if response body exists and contains error details if (response.body && response.body.error) { throw response.body.error } - + // Handle case where response body is missing if (!response.body) { throw new Error( `Failed to get response from AI service (status: ${response.status})${errorCodeMsg}. ` + - 'Please check network connection and endpoint configuration.' + 'Please check network connection and endpoint configuration.' ) } - + // Handle other error cases throw new Error( `AI service returned error response (status: ${response.status})${errorCodeMsg}: ` + - (typeof response.body === 'string' ? response.body : JSON.stringify(response.body)) + (typeof response.body === 'string' + ? response.body + : JSON.stringify(response.body)) ) }