Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #212674 #213583

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
};

const stopWatch = new StopWatch();
let context: IRequestContext | undefined, error: ExtensionGalleryError | undefined, total: number = 0;
let context: IRequestContext | undefined, errorCode: ExtensionGalleryErrorCode | undefined, total: number = 0;

try {
context = await this.requestService.request({
Expand Down Expand Up @@ -989,9 +989,14 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
return { galleryExtensions: [], total };

} catch (e) {
const errorCode = isCancellationError(e) ? ExtensionGalleryErrorCode.Cancelled : getErrorMessage(e).startsWith('XHR timeout') ? ExtensionGalleryErrorCode.Timeout : ExtensionGalleryErrorCode.Failed;
error = new ExtensionGalleryError(getErrorMessage(e), errorCode);
throw error;
if (isCancellationError(e)) {
errorCode = ExtensionGalleryErrorCode.Cancelled;
throw e;
} else {
const errorMessage = getErrorMessage(e);
errorCode = errorMessage.startsWith('XHR timeout') ? ExtensionGalleryErrorCode.Timeout : ExtensionGalleryErrorCode.Failed;
throw new ExtensionGalleryError(errorMessage, errorCode);
}
} finally {
this.telemetryService.publicLog2<GalleryServiceQueryEvent, GalleryServiceQueryClassification>('galleryService:query', {
...query.telemetryData,
Expand All @@ -1000,7 +1005,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
success: !!context && isSuccess(context),
responseBodySize: context?.res.headers['Content-Length'],
statusCode: context ? String(context.res.statusCode) : undefined,
errorCode: error?.code,
errorCode,
count: String(total)
});
}
Expand Down
Loading