init
This commit is contained in:
20
src/database/exception.ts
Normal file
20
src/database/exception.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user