Add initial project files

This commit is contained in:
Igor Martyniuk
2026-09-01 13:03:41 +03:00
parent 22e111bb44
commit 74cb5b6176
1841 changed files with 242819 additions and 30 deletions
@@ -0,0 +1,55 @@
import ApiException from '#exceptions/api_exception'
export class PageNotFoundException extends ApiException {
static status = 404
static code = 'E_PAGE_NOT_FOUND'
constructor(resource: string = 'Page') {
super(`${resource} not found`)
}
}
export class PageRouteConflictException extends ApiException {
static status = 409
static code = 'E_PAGE_ROUTE_CONFLICT'
constructor(locale: string, path: string) {
super(`A page already uses /${locale}/${path}`)
}
}
export class PageNotPublishedException extends ApiException {
static status = 409
static code = 'E_PAGE_NOT_PUBLISHED'
constructor() {
super('Only a published page can be unpublished')
}
}
export class InvalidPagePayloadException extends ApiException {
static status = 422
static code = 'E_INVALID_PAGE_PAYLOAD'
constructor(message: string = 'Invalid page payload') {
super(message)
}
}
export class PageMediaFileMissingException extends ApiException {
static status = 422
static code = 'E_PAGE_MEDIA_FILE_MISSING'
constructor(fileKey: string) {
super(`Missing uploaded file for key "${fileKey}"`)
}
}
export class PageMediaFileInvalidException extends ApiException {
static status = 422
static code = 'E_PAGE_MEDIA_FILE_INVALID'
constructor(fileKey: string, message?: string) {
super(message || `Invalid uploaded file for key "${fileKey}"`)
}
}