KubeMQ
IntegrationsNestJSReference

Error Codes

The exported error types of @kubemq/nestjs-transport, the KubeMQRpcException shape, and a troubleshooting / FAQ table.

This page catalogs the error types @kubemq/nestjs-transport throws and a troubleshooting table for the most common failures. For configuration options see Configuration; for the decorator and context surface see the API reference.

Errors

KubeMQRpcException extends the NestJS RpcException and carries a structured KubeMQRpcError. Two mapper helpers convert raw kubemq-js errors into it. The package also exports a set of advanced operational errors.

ExportDescription
KubeMQRpcExceptionRpcException subclass carrying a KubeMQRpcError
KubeMQRpcErrorInterface: { statusCode, message, kubemqCode, kubemqCategory, channel? }
mapErrorToRpcException(error)Maps a kubemq-js error to KubeMQRpcException
mapToRpcException(error)Maps any error to KubeMQRpcException
SerializationErrorThrown when serialization or deserialization fails
ConnectionNotReadyErrorRe-exported from kubemq-js; thrown when operating on an unready connection
CircuitBreakerOpenErrorThrown when the client circuit breaker is open and rejects a call
BackpressureOverflowErrorThrown when the internal concurrency FIFO exceeds maxQueueDepth
DeadLetterErrorThrown when a message is routed to its dead-letter channel after retries
MessageValidationErrorThrown when a validate DTO fails class-validator checks
DuplicateMessageErrorThrown when idempotency dedup detects a repeated message

The KubeMQRpcError carried by every KubeMQRpcException has a stable shape; catch the exception and read its structured fields in an exception filter:

exception-filter.ts
import { Catch, ArgumentsHost } from '@nestjs/common';
import { BaseRpcExceptionFilter } from '@nestjs/microservices';
import { KubeMQRpcException } from '@kubemq/nestjs-transport';
import type { KubeMQRpcError } from '@kubemq/nestjs-transport';

@Catch(KubeMQRpcException)
export class KubeMQExceptionFilter extends BaseRpcExceptionFilter {
  catch(exception: KubeMQRpcException, host: ArgumentsHost) {
    const error = exception.getError() as KubeMQRpcError;
    console.error(`[${error.kubemqCategory}] ${error.kubemqCode}: ${error.message}`);
    return super.catch(exception, host);
  }
}

For mapper behavior and verbose-error handling, see Configuration & Resilience → Error handling.

Troubleshooting / FAQ

See Also

Was this page helpful?

On this page