Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): Log a backtrace when RPC fails. Closes #1223 #1224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/server/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ open DebugMessage
open ErrorUtils
open Api
open IPCUtil
open Printexc

(* You can swap the RPC engine, by using a different monad here,
note however that if you are using an asynchronous one, like
Expand Down Expand Up @@ -58,11 +59,12 @@ let handler rpc conn =
should ensure that the computation is started by a runner *)
let res =
try M.run (rpc req)
with _ ->
with e ->
let exc_str = Caml.Printexc.get_backtrace() in
Rpc.failure
(RPCError.rpc_of_t
RPCError.
{ code = 0; message = "scilla-server: incorrect invocation" })
( RPCError.rpc_of_t
RPCError.
{ code = 0; message = "scilla-server: exception " ^ exc_str } )
in
let str = Jsonrpc.string_of_response ~version:Jsonrpc.V2 res in
IPCUtil.send_delimited oc str
Expand Down