Files
speckle-server/packages/server/modules/notifications/errors/index.ts
T
2022-08-19 10:27:48 +03:00

21 lines
770 B
TypeScript

import { BaseError } from '@/modules/shared/errors/base'
export class UnhandledNotificationError extends BaseError {
static code = 'UNHANDLED_NOTIFICATION_ERROR'
static defaultMessage = 'A notification without a valid handler has arrived'
}
export class InvalidNotificationError extends BaseError {
static code = 'INVALID_NOTIFICATION_ERROR'
static defaultMessage = 'Received an invalid notification'
}
/**
* If this notification is thrown from a notification handler, the error will be logged, but
* the notification will be acknowledged and not re-queued
*/
export class NotificationValidationError extends BaseError {
static code = 'NOTIFICATION_VALIDATION_ERROR'
static defaultMessage = 'Processing a notification failed due to invalid metadata'
}