refactor(tts): remove InputError class and use native Error

This commit is contained in:
mitchell 2026-06-16 16:45:17 -04:00
parent 710d2e7593
commit fc7d9101e9

10
tts.ts
View file

@ -12,10 +12,6 @@ import { execa } from "execa";
import { Window } from "happy-dom";
import wrapAnsi from "wrap-ansi";
class InputError extends Error {
override name = "InputError";
}
async function main() {
const start = Date.now();
@ -48,9 +44,7 @@ async function main() {
}
if (!input) {
throw new InputError(
"No input was given. Use positional arguments or stdin.",
);
throw new Error("No input was given. Use positional arguments or stdin.");
}
if (url) {
@ -61,7 +55,7 @@ async function main() {
await window.happyDOM.waitUntilComplete();
const readable = new Readability(doc).parse();
if (!readable?.textContent) {
throw new InputError(
throw new Error(
"Unable to read webpage. This usually means it's blocking scrapers.",
);
}