File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import { DisposableObject } from './vscode-utils/disposable-object' ;
2+ import { showAndLogErrorMessage } from './helpers' ;
23
34/**
45 * Base class for "discovery" operations, which scan the file system to find specific kinds of
@@ -9,7 +10,7 @@ export abstract class Discovery<T> extends DisposableObject {
910 private retry = false ;
1011 private discoveryInProgress = false ;
1112
12- constructor ( ) {
13+ constructor ( private readonly name : string ) {
1314 super ( ) ;
1415 }
1516
@@ -59,6 +60,11 @@ export abstract class Discovery<T> extends DisposableObject {
5960 this . update ( results ) ;
6061 }
6162 } ) ;
63+
64+ discoveryPromise . catch ( err => {
65+ showAndLogErrorMessage ( `${ this . name } failed. Reason: ${ err . message } ` ) ;
66+ } ) ;
67+
6268 discoveryPromise . finally ( ( ) => {
6369 if ( this . retry ) {
6470 // Another refresh request came in while we were still running a previous discovery
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class QLPackDiscovery extends Discovery<QlpacksInfo> {
2020 private readonly workspaceFolder : WorkspaceFolder ,
2121 private readonly cliServer : CodeQLCliServer
2222 ) {
23- super ( ) ;
23+ super ( 'QL Pack Discovery' ) ;
2424
2525 // Watch for any changes to `qlpack.yml` files in this workspace folder.
2626 // TODO: The CLI server should tell us what paths to watch for.
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export class QLTestDiscovery extends Discovery<QLTestDiscoveryResults> {
119119 private readonly workspaceFolder : WorkspaceFolder ,
120120 private readonly cliServer : CodeQLCliServer
121121 ) {
122- super ( ) ;
122+ super ( 'QL Test Discovery' ) ;
123123
124124 this . push ( this . qlPackDiscovery . onDidChangeQLPacks ( this . handleDidChangeQLPacks , this ) ) ;
125125 this . push ( this . watcher . onDidChange ( this . handleDidChange , this ) ) ;
You can’t perform that action at this time.
0 commit comments