Skip to content

Commit 60247ec

Browse files
committed
Shows an error item instead of filling the placeholder on an error with no-result
(#4492, #4748)
1 parent b2c3a99 commit 60247ec

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/plus/launchpad/launchpad.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,11 @@ export class LaunchpadCommand extends QuickCommand<State> {
577577
const result = context.inSearch ? context.searchResult : context.result;
578578

579579
if (result?.error != null && !result?.items?.length) {
580+
const errorItem = this.createErrorQuickPickItem(result.error);
580581
return {
581582
title: `${context.title} \u00a0\u2022\u00a0 Unable to Load Items`,
582-
placeholder: `Unable to load items (${
583-
result.error.name === 'HttpError' &&
584-
'status' in result.error &&
585-
typeof result.error.status === 'number'
586-
? `${result.error.status}: ${String(result.error)}`
587-
: String(result.error)
588-
})`,
589-
items: [createDirectiveQuickPickItem(Directive.Cancel, undefined, { label: 'OK' })],
583+
placeholder: 'Unable to load items',
584+
items: [errorItem],
590585
};
591586
}
592587

0 commit comments

Comments
 (0)