From 8bdea824e2d904a190430615583a0f4cde99fd51 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 16 Oct 2026 18:51:35 +0100 Subject: [PATCH] Move `ConfigurationError` out of `util.ts` --- lib/entry-points.js | 6 ++++-- src/errors/index.ts | 5 +++++ src/util.ts | 8 ++------ 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 src/errors/index.ts diff --git a/lib/entry-points.js b/lib/entry-points.js index 1a99a4442..3d3dc758f 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -169373,6 +169373,10 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.23"; var minimumVersion = "3.18"; +// src/errors/index.ts +var ConfigurationError = class extends Error { +}; + // src/json/index.ts function parseString(data) { return JSON.parse(data); @@ -169830,8 +169834,6 @@ var HTTPError = class extends Error { this.status = status; } }; -var ConfigurationError = class extends Error { -}; function asHTTPError(arg) { if (!isObject2(arg) || !isString(arg.message)) { return void 0; diff --git a/src/errors/index.ts b/src/errors/index.ts new file mode 100644 index 000000000..26bb63a9c --- /dev/null +++ b/src/errors/index.ts @@ -0,0 +1,5 @@ +/** + * An Error class that indicates an error that occurred due to + * a misconfiguration of the action or the CodeQL CLI. + */ +export class ConfigurationError extends Error {} diff --git a/src/util.ts b/src/util.ts index 02e105d57..f12059ced 100644 --- a/src/util.ts +++ b/src/util.ts @@ -23,11 +23,13 @@ import { getEnv, type Env, } from "./environment"; +import { ConfigurationError } from "./errors"; import * as json from "./json"; import { Language } from "./languages"; import { Logger } from "./logging"; // Re-export for backwards compatibility to avoid updating a lot of imports elsewhere. +export { ConfigurationError } from "./errors"; export { getRequiredEnvParam, getOptionalEnvVar, @@ -573,12 +575,6 @@ export class HTTPError extends Error { } } -/** - * An Error class that indicates an error that occurred due to - * a misconfiguration of the action or the CodeQL CLI. - */ -export class ConfigurationError extends Error {} - export function asHTTPError(arg: any): HTTPError | undefined { if (!json.isObject(arg) || !json.isString(arg.message)) { return undefined;