Skip to content

Commit fd72fba

Browse files
committed
Add cancellation token reason logging and rethrow before retry logic in make_api_request
1 parent a04b71b commit fd72fba

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/vscode/src/utils/make-api-request.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,15 @@ export const make_api_request = async (params: {
379379
})
380380
})
381381
} catch (error) {
382+
if (params.cancellation_token?.reason) {
383+
Logger.info({
384+
function_name: 'make_api_request',
385+
message: 'Request canceled',
386+
data: params.cancellation_token.reason
387+
})
388+
throw params.cancellation_token.reason
389+
}
390+
382391
// Check if it's a retryable error
383392
const is_retryable_error =
384393
(axios.isAxiosError(error) &&

0 commit comments

Comments
 (0)