Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-grpc-exceptions

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-grpc-exceptions

NestJS gRPC Exceptions

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7K
increased by12.05%
Maintainers
1
Weekly downloads
 
Created
Source

NestJS gRPC Exceptions

This library provides RpcException wrappers for gRPC status codes.

Install

pnpm add nestjs-grpc-exceptions

or

npm install nestjs-grpc-exceptions

or

yarn add nestjs-grpc-exceptions

Usage:

First add the GrpcServerExceptionFilter to your gRPC server:

import { Module } from "@nestjs/common";
import { APP_FILTER } from "@nestjs/core";
import { GrpcServerExceptionFilter } from "nestjs-grpc-exceptions";

@Module({
  providers: [
    {
      provide: APP_FILTER,
      useClass: GrpcServerExceptionFilter,
    },
  ],
})
export class UserModule {}

Now you can use the exception classes:

throw new GrpcNotFoundException("User Not Found.");
throw new GrpcInvalidArgumentException("input 'name' is not valid.");

ALERT 🚨

This library is in its early development. Be careful about using it in a production environment.

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc