Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
nestjs-grpc-exceptions
Advanced tools
This library provides RpcException
wrappers for gRPC status codes.
pnpm add nestjs-grpc-exceptions
or
npm install nestjs-grpc-exceptions
or
yarn add nestjs-grpc-exceptions
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 {}
Add the client interceptor to your client:
import { GrpcToHttpInterceptor } from 'nestjs-grpc-exceptions';
@Get(':id')
@UseInterceptors(GrpcToHttpInterceptor)
function findUser(@Param('id') id: number): void;
Now you can use the exception classes in your servers:
import {
GrpcNotFoundException,
GrpcInvalidArgumentException,
} from "nestjs-grpc-exceptions";
throw new GrpcNotFoundException("User Not Found.");
throw new GrpcInvalidArgumentException("input 'name' is not valid.");
If you use Http Exceptions in your microservice clients, you can use the HttpToGrpcInterceptor interceptor to convert them
import { HttpToGrpcInterceptor } from 'nestjs-grpc-exceptions';
@UseInterceptors(HttpToGrpcInterceptor)
@GrpcMethod()
function getAllUsers(): void;
list of supported http status codes: 401 - 403 - 502 - 404 - 405 - 409 - 422 - 429 - 500
0.2.2
FAQs
NestJS gRPC Exceptions
The npm package nestjs-grpc-exceptions receives a total of 4,171 weekly downloads. As such, nestjs-grpc-exceptions popularity was classified as popular.
We found that nestjs-grpc-exceptions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.