Files
speckle-server/packages/server/modules/fileuploads/helpers/errors.ts
T
Iain Sproat 8a74d9cbe3 feat(file importer): server has REST API to receive results about a file import (#4688)
* fix(server): remove redundant code from bad merge

* wrong router

* WIP: http api for receiving file import results

* Lints

* fix

* WIP: tests

* test fix

* auth middleware has implicit requirement for param named streamId

* complete tests and fixes

* can run the old way alongside the existing, no conflicts

* tidying

* correct error thrown

* incorporate review comments
2025-05-08 19:12:15 +02:00

21 lines
756 B
TypeScript

import { BaseError } from '@/modules/shared/errors'
//TODO this represents an internal server error and not a client/user error (e.g. error in a file content)
export class FileUploadInternalError extends BaseError {
static defaultMessage = 'A file upload error occurred.'
static code = 'FILE_UPLOAD_ERROR'
static statusCode = 500
}
export class FileImportJobNotFoundError extends BaseError {
static defaultMessage = 'The file upload job was not found.'
static code = 'FILE_IMPORT_JOB_NOT_FOUND'
static statusCode = 404
}
export class FileImportInvalidJobResultPayload extends BaseError {
static defaultMessage = 'The file upload job result was invalid.'
static code = 'FILE_IMPORT_INVALID_JOB_RESULT_PAYLOAD'
static statusCode = 400
}