Skip to content

Commit

Permalink
Remove unnecessary extra error type in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jun 13, 2024
1 parent 85e6d45 commit 0f43a47
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const debug = require("debug")("Eleventy:cmd");

(async function () {
const { default: EleventyErrorHandler } = await import("./src/Errors/EleventyErrorHandler.js");
const { default: EleventyBaseError } = await import("./src/Errors/EleventyBaseError.js");

class EleventyCommandCheckError extends EleventyBaseError {}

try {
let errorHandler = new EleventyErrorHandler();
Expand All @@ -43,7 +40,7 @@ const debug = require("debug")("Eleventy:cmd");
"ignore-initial": false,
},
unknown: function (unknownArgument) {
throw new EleventyCommandCheckError(
throw new Error(
`We don’t know what '${unknownArgument}' is. Use --help to see the list of supported commands.`,
);
},
Expand Down Expand Up @@ -129,7 +126,7 @@ const debug = require("debug")("Eleventy:cmd");
} else if (!argv.to || argv.to === "fs") {
elev.write();
} else {
throw new EleventyCommandCheckError(
throw new Error(
`Invalid --to value: ${argv.to}. Supported values: \`fs\` (default), \`json\`, and \`ndjson\`.`,
);
}
Expand Down

0 comments on commit 0f43a47

Please sign in to comment.