UNPKG

@golevelup/nestjs-rabbitmq

Version:
47 lines 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConnectionNotAvailableError = exports.ChannelNotAvailableError = exports.NullMessageError = exports.RpcTimeoutError = void 0; /** * Custom error thrown when an RPC request times out waiting for a response. */ class RpcTimeoutError extends Error { constructor(timeout, exchange, routingKey) { super(`Failed to receive response within timeout of ${timeout}ms for exchange "${exchange}" and routing key "${routingKey}"`); this.timeout = timeout; this.exchange = exchange; this.routingKey = routingKey; this.name = 'RpcTimeoutError'; } } exports.RpcTimeoutError = RpcTimeoutError; /** * Custom error thrown when a message is null or undefined. */ class NullMessageError extends Error { constructor() { super('Received null message'); this.name = 'NullMessageError'; } } exports.NullMessageError = NullMessageError; /** * Custom error thrown when a channel is not available. */ class ChannelNotAvailableError extends Error { constructor() { super('channel is not available'); this.name = 'ChannelNotAvailableError'; } } exports.ChannelNotAvailableError = ChannelNotAvailableError; /** * Custom error thrown when a connection is not available. */ class ConnectionNotAvailableError extends Error { constructor() { super('connection is not available'); this.name = 'ConnectionNotAvailableError'; } } exports.ConnectionNotAvailableError = ConnectionNotAvailableError; //# sourceMappingURL=errors.js.map