File

lib/shared/exceptions/ms.exception.ts

Description

Base class for custom microservice exceptions, extending RpcException.

Extends

RpcException

Constructor

constructor(code: number, message: string, stack?: any)
Parameters :
Name Type Optional
code number No
message string No
stack any Yes
import { RpcException } from "@nestjs/microservices";
import { MS_EXCEPTION_ID } from "../constants";

/**
 * Base class for custom microservice exceptions, extending RpcException.
 */
export class MsException extends RpcException {
  constructor(
    readonly code: number,
    readonly message: string = undefined,
    readonly stack?: any,
  ) {
    super({ type: MS_EXCEPTION_ID, message, code, stack });
  }
}

results matching ""

    No results matching ""