56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import { Exception } from '@adonisjs/core/exceptions'
|
|
|
|
export class FilenameMissingExtensionException extends Exception {
|
|
static status = 400
|
|
static code = 'E_FILE_NAME_MISSING_EXTENSION'
|
|
|
|
constructor(message: string = 'File name missing extension') {
|
|
super(message)
|
|
}
|
|
}
|
|
|
|
export class EntryNameNotChangedException extends Exception {
|
|
static status = 400
|
|
static code = 'E_ENTRY_NAME_NOT_CHANGED'
|
|
|
|
constructor(message: string = 'Entry name was not changed') {
|
|
super(message)
|
|
}
|
|
}
|
|
|
|
export class EntryExistsException extends Exception {
|
|
static status = 400
|
|
static code = 'E_ENTRY_ALREADY_EXISTS'
|
|
|
|
constructor(message: string = 'Entry already exists') {
|
|
super(message)
|
|
}
|
|
}
|
|
|
|
export class DirExistsException extends Exception {
|
|
static status = 400
|
|
static code = 'E_DIRECTORY_ALREADY_EXISTS'
|
|
|
|
constructor(message: string = 'Directory already exists') {
|
|
super(message)
|
|
}
|
|
}
|
|
|
|
export class FileNotFoundException extends Exception {
|
|
static status = 404
|
|
static code = 'E_FILE_NOT_FOUND'
|
|
|
|
constructor(message: string = 'File not found') {
|
|
super(message)
|
|
}
|
|
}
|
|
|
|
export class DirNotFoundException extends Exception {
|
|
static status = 404
|
|
static code = 'E_DIR_NOT_FOUND'
|
|
|
|
constructor(message: string = 'Directory not found') {
|
|
super(message)
|
|
}
|
|
}
|