@message-queue-toolkit/core
Version:
Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently
25 lines • 823 B
JavaScript
import { InternalError } from '@lokalise/node-core';
export class MessageInvalidFormatError extends InternalError {
constructor(params) {
super({
message: params.message,
errorCode: 'MESSAGE_INVALID_FORMAT',
details: params.details,
});
this.name = 'MessageInvalidFormat';
}
}
export class MessageValidationError extends InternalError {
constructor(params) {
super({
message: params.message,
errorCode: 'MESSAGE_VALIDATION_ERROR',
details: params.details,
});
this.name = 'MessageValidationError';
}
}
export function isMessageError(err) {
return ((err && (err.name === 'MessageValidationError' || err.name === 'MessageInvalidFormat')) ?? false);
}
//# sourceMappingURL=Errors.js.map