all repos — kitten @ bc04a989a64e18f1af70503566539148a79f8a44

pkgs/router/src/errors.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
import { InteractionReplyOptions } from "discord.js";

export class HaltExecution extends Error {
	constructor(public replyPayload?: string | InteractionReplyOptions) {
		super("execution halted by middleware.");
		this.name = "HaltExecution";
	}
}

export class CustomIdTooLong extends Error {
	constructor(componentName: string, length: number) {
		super(
			`custom ID for component "${componentName}" is too long (${length} characters). discord limits custom IDs to 100 characters.`,
		);
	}
}