Skip to content

Commit e5f3a97

Browse files
elenatanasoiuchariskshati-patel
committed
Improve experience when controller repo does not exist
The controller repo is set via the `codeQL.variantAnalysis.controllerRepo` setting in VSCode. While we have validation to check that the repo is not null and the format of the controller repo is correct: `<owner>/<repo>`, we still allow you to provide a non-existent repo (e.g. a mispelled one). When the MRVA request is sent over to the API, it will verify that the repo exists and return a very generic "Not Found" response. This will then be logged out in the "Output" tab for VSCode. We'd like to give users a better indication of what has gone wrong in this case so we're making the error message more verbose. Co-authored-by: Charis Kyriakou <charisk@github.com> Co-authored-by: Shati Patel <shati-patel@github.com>
1 parent b290625 commit e5f3a97

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

extensions/ql-vscode/src/remote-queries/run-remote-query.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,12 @@ async function runRemoteQueriesApiRequest(
333333
const { popupMessage, logMessage } = parseResponse(owner, repo, response.data);
334334
void showAndLogInformationMessage(popupMessage, { fullMessage: logMessage });
335335
return response.data.workflow_run_id;
336-
} catch (error) {
337-
void showAndLogErrorMessage(getErrorMessage(error));
336+
} catch (error: any) {
337+
if (error.status === 404) {
338+
void showAndLogErrorMessage(`Controller repository was not found. Please make sure it's a valid repo name.${eol}`);
339+
} else {
340+
void showAndLogErrorMessage(getErrorMessage(error));
341+
}
338342
}
339343
}
340344

0 commit comments

Comments
 (0)