A lightweight library (v0.2.2) for NestJS that provides gRPC exception wrappers corresponding to standard gRPC status codes (e.g., NotFound, InvalidArgument). It includes a server-side exception filter (GrpcServerExceptionFilter) to automatically convert thrown exceptions to gRPC errors, and client-side interceptors (GrpcToHttpInterceptor, HttpToGrpcInterceptor) to bridge between HTTP and gRPC error formats. Requires @grpc/grpc-js, @nestjs/common, @nestjs/core, and @nestjs/microservices as peer dependencies. Compatible with NestJS 9 and 10. Actively maintained with TypeScript types included.
npm install nestjs-grpc-exceptionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use the global exception filter and throw gRPC exceptions in a NestJS module.
Use APP_FILTER provider as shown in the documentation.
Import all symbols directly from 'nestjs-grpc-exceptions'.
Ensure your application uses @nestjs/microservices gRPC transport.
Apply the interceptor to controller methods that call gRPC services.
Run 'npm install nestjs-grpc-exceptions' and ensure tsconfig.json includes 'node_modules/@types'.
Use ES6 import syntax: import { GrpcNotFoundException } from 'nestjs-grpc-exceptions'Add it to a module's providers array, preferably as an APP_FILTER.