21 lines
549 B
TypeScript
21 lines
549 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 DuplicateTemplateException extends DatabaseException {
|
|
constructor(templateName: string) {
|
|
super(`Template with name "${templateName}" already exists`)
|
|
this.name = 'DuplicateTemplateException'
|
|
}
|
|
}
|