Files
speckle-server/packages/server/modules/comments/errors/index.ts
T
Iain Sproat f93d9093a0 fix(errors): all error should define an appropriate status code (#3112)
* fix(errors): all error should define a status code (default is 500)
- rename NoInviteFoundError to InviteNotFoundError to match xNotFoundError pattern

* remove unused errors
2024-09-25 13:08:13 +02:00

20 lines
633 B
TypeScript

import { BaseError } from '@/modules/shared/errors/base'
export class InvalidAttachmentsError extends BaseError {
static defaultMessage = 'Invalid comment attachments specified'
static code = 'INVALID_ATTACHMENTS'
static statusCode = 400
}
export class CommentCreateError extends BaseError {
static defaultMessage = 'An error occurred while creating a new comment'
static code = 'COMMENT_CREATE_ERROR'
static statusCode = 500
}
export class CommentUpdateError extends BaseError {
static defaultMessage = 'An error occurred while updating a comment'
static code = 'COMMENT_UPDATE_ERROR'
static statusCode = 400
}