Utility error class for gRPC error responses that can carry custom details. Version 1.1.1 is the latest stable release. The package is actively maintained and designed to work with @grpc/grpc-js. It differs from similar libraries by allowing arbitrary metadata and nesting of error details, making it suitable for rich error reporting in gRPC services.
npm install grpc-error-extraNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a GrpcError with custom details and access its properties.
Always pass an object as the second argument. Use { statusCode: ... } for gRPC status codes.Ensure your @grpc/grpc-js version is compatible; if upgrading, test error handling.
Use the status enum from @grpc/grpc-js to ensure valid codes.
Run: npm install @grpc/grpc-js
Use correct import: import { GrpcError } from 'grpc-error-extra'