Files
infio-copilot/src/database/exception.ts
2025-04-24 16:22:46 +08:00

21 lines
544 B
TypeScript

export class DatabaseException extends Error {
constructor(message: string) {
super(message)
this.name = 'DatabaseException'
}
}
export class DatabaseNotInitializedException extends DatabaseException {
constructor(message = 'Database not initialized') {
super(message)
this.name = 'DatabaseNotInitializedException'
}
}
export class DuplicateCommandException extends DatabaseException {
constructor(commandName: string) {
super(`Command with name "${commandName}" already exists`)
this.name = 'DuplicateCommandException'
}
}