mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-01-02 21:53:12 +00:00
Move CancelledError handling to outer try/except of RpcWebsocketServer
This commit is contained in:
parent
c5c40af304
commit
85d6a67fbc
@ -64,8 +64,6 @@ proc serveHTTP*(rpc: RpcWebSocketHandler, request: HttpRequest)
|
||||
|
||||
let data = try:
|
||||
await rpc.route(string.fromBytes(recvData))
|
||||
except CancelledError as exc:
|
||||
raise exc
|
||||
except CatchableError as exc:
|
||||
debug "Internal error, while processing RPC call",
|
||||
address = $request.uri
|
||||
@ -80,6 +78,9 @@ proc serveHTTP*(rpc: RpcWebSocketHandler, request: HttpRequest)
|
||||
except WebSocketError as exc:
|
||||
error "WebSocket error:", exception = exc.msg
|
||||
|
||||
except CancelledError as exc:
|
||||
raise exc
|
||||
|
||||
except CatchableError as exc:
|
||||
error "Something error", msg=exc.msg
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user