File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/remote-queries Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { QuickPickItem , window } from 'vscode' ;
2- import { showAndLogErrorMessage } from '../helpers' ;
32import { logger } from '../logging' ;
43import { getRemoteRepositoryLists } from '../config' ;
54import { REPO_REGEX } from '../pure/helpers-pure' ;
5+ import { UserCancellationException } from '../commandRunner' ;
66
77export interface RepositorySelection {
88 repositories ?: string [ ] ;
@@ -44,14 +44,14 @@ export async function getRepositorySelection(): Promise<RepositorySelection> {
4444 } else if ( quickpick ?. useCustomRepository ) {
4545 const customRepo = await getCustomRepo ( ) ;
4646 if ( ! customRepo || ! REPO_REGEX . test ( customRepo ) ) {
47- void showAndLogErrorMessage ( 'Invalid repository format. Please enter a valid repository in the format <owner>/<repo> (e.g. github/codeql)' ) ;
48- return { } ;
47+ throw new UserCancellationException ( 'Invalid repository format. Please enter a valid repository in the format <owner>/<repo> (e.g. github/codeql)' ) ;
4948 }
5049 void logger . log ( `Entered repository: ${ customRepo } ` ) ;
5150 return { repositories : [ customRepo ] } ;
5251 } else {
53- void showAndLogErrorMessage ( 'No repositories selected.' ) ;
54- return { } ;
52+ // We don't need to display a warning pop-up in this case, since the user just escaped out of the operation.
53+ // We set 'true' to make this a silent exception.
54+ throw new UserCancellationException ( 'No repositories selected' , true ) ;
5555 }
5656}
5757
You can’t perform that action at this time.
0 commit comments