vs-streamjsonrpc icon indicating copy to clipboard operation
vs-streamjsonrpc copied to clipboard

Exception details appear to be dropped after second hop

Open AArnott opened this issue 4 years ago • 2 comments

When an RPC chain exists such that an RPC client invokes a server, which as part of serving that request makes its own RPC call, if the second server throws an exception, the first server sees the remote exception details but the original client only sees the callstack of the intermediate server when it rethrew the exception. Ideally the original client would somehow see stacks of both RPC servers

AArnott avatar Sep 24 '21 16:09 AArnott

but the original client only sees the callstack of the intermediate server when it rethrew the exception.

This was also pretty confusing as it made it seem as if the error message we were seeing was associated with the RPC mechanism itself, making us think it was the RPC layer at fault (or our immediate use of it). :)

CyrusNajmabadi avatar Sep 24 '21 17:09 CyrusNajmabadi

I'm afraid that will likely always be the case, because within the process the exception is first thrown from JsonRpc.InvokeAsync. You just have to know that like TargetInvocationException, RemoteInvocationException is just a wrapper and means it's the server's fault.

AArnott avatar Sep 24 '21 22:09 AArnott