Skip to content

Commit dee5a5e

Browse files
committed
fix lint
1 parent 37fe8eb commit dee5a5e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,26 @@ export async function run(): Promise<void> {
8585
// Extract x-ms-error-code from headers if available
8686
const errorCode = response.headers['x-ms-error-code']
8787
const errorCodeMsg = errorCode ? ` (error code: ${errorCode})` : ''
88-
88+
8989
// Check if response body exists and contains error details
9090
if (response.body && response.body.error) {
9191
throw response.body.error
9292
}
93-
93+
9494
// Handle case where response body is missing
9595
if (!response.body) {
9696
throw new Error(
9797
`Failed to get response from AI service (status: ${response.status})${errorCodeMsg}. ` +
98-
'Please check network connection and endpoint configuration.'
98+
'Please check network connection and endpoint configuration.'
9999
)
100100
}
101-
101+
102102
// Handle other error cases
103103
throw new Error(
104104
`AI service returned error response (status: ${response.status})${errorCodeMsg}: ` +
105-
(typeof response.body === 'string' ? response.body : JSON.stringify(response.body))
105+
(typeof response.body === 'string'
106+
? response.body
107+
: JSON.stringify(response.body))
106108
)
107109
}
108110

0 commit comments

Comments
 (0)