Refactor configuration errors (#2105)

Refactor the existing classes of configuration errors into their own file; consolidate the place we check for configuration errors into `codeql.ts`, where the actual command invocations happen.

Also, rename the `UserError` type to `ConfigurationError` to standardize on a single term.
This commit is contained in:
Angela P Wen
2024-02-08 09:20:03 -08:00
committed by GitHub
parent fc9f9e5ef9
commit 1515e2bb20
54 changed files with 654 additions and 502 deletions

View File

@@ -875,9 +875,11 @@ test("database finalize recognises JavaScript no code found error on CodeQL 2.11
await t.throwsAsync(
async () => await codeqlObject.finalizeDatabase("", "", ""),
{
message:
instanceOf: util.ConfigurationError,
message: new RegExp(
"No code found during the build. Please see: " +
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build",
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build.+",
),
},
);
});
@@ -892,9 +894,11 @@ test("database finalize overrides no code found error on CodeQL 2.11.6", async (
await t.throwsAsync(
async () => await codeqlObject.finalizeDatabase("", "", ""),
{
message:
instanceOf: util.ConfigurationError,
message: new RegExp(
"No code found during the build. Please see: " +
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build",
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build.+",
),
},
);
});