deeplay-io / nice-grpc

A TypeScript gRPC library that is nice to you

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is no way to see clean error message is middleware (nice-grpc-web)

skycrazyk opened this issue · comments

The problem

There is no way to see clean error message in middleware if error (at least transport error) has stack trace.

image

My debug research

In case of transport error here we get into handleTransportErrors. It's catch section transforms a fetch transport error into the ClientError using makeInternalErrorMedssage function witch returns stack trace (as details param) or message if stack is empty.

Hey,

What do you expect to see in such errors? Just Transport error: Failed to fetch without a stack trace?

Hey,

What do you expect to see in such errors? Just Transport error: Failed to fetch without a stack trace?

Yes. Because I want to show this message in UI and it still possible use console.error(error.stack) if need.

Published the fix in 📦 nice-grpc-web@3.3.1