mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-01-08 00:23:12 +00:00
Client pass meaningful error to newFut when processMessage failed
This commit is contained in:
parent
26a6cb1790
commit
dad0255c71
@ -152,10 +152,11 @@ method call*(client: RpcHttpClient, name: string,
|
||||
if msgRes.isErr:
|
||||
# Need to clean up in case the answer was invalid
|
||||
debug "Failed to process POST Response for JSON-RPC", msg = msgRes.error
|
||||
newFut.cancelSoon()
|
||||
let exc = newException(JsonRpcError, msgRes.error)
|
||||
newFut.fail(exc)
|
||||
client.awaiting.del(id)
|
||||
closeRefs()
|
||||
raise newException(JsonRpcError, msgRes.error)
|
||||
raise exc
|
||||
|
||||
client.awaiting.del(id)
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ proc handleRequest(rpc: RpcWebSocketServer, request: HttpRequest) {.async: (rais
|
||||
debug "Internal error, while processing RPC call",
|
||||
address = $request.uri
|
||||
await ws.close(
|
||||
reason = "Internal error, while processing RPC call"
|
||||
reason = "Internal error, while processing RPC call: " & exc.msg
|
||||
)
|
||||
break
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user