Deserializes `grpc-status-details-bin` metadata from gRPC-Web errors into Google's richer error model (Status + typed error details like BadRequest, RetryInfo). Version 1.1.0, stable with sporadic updates. Requires `grpc-web` (>=1.2.1) and `google-protobuf` (>=3.15.8). Uses `instanceof` type guards for TypeScript. Unlike `@stackpath/node-grpc-error-details` for Node, this is specifically for browser gRPC-Web clients.
npm install grpc-web-error-detailsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to catch a gRPC-Web error, deserialize status details, and iterate over BadRequest field violations using instanceof type guards.
Use if (status && details) before accessing members.
Use detail.getFieldViolationsList() instead of detail.fieldViolations.
Switch to @bufbuild/protobuf and adapt library usage accordingly (note: grpc-web-error-details currently depends on google-protobuf).
Always import detail classes from 'grpc-web-error-details', not from 'google-protobuf'.
Use @stackpath/node-grpc-error-details on Node.js.
Always check if status and details are truthy before iterating.
Use `import { statusFromError } from 'grpc-web-error-details'`.Use `import { statusFromError } from 'grpc-web-error-details'`.