Skip to content

Commit

Permalink
refactor(rpc): do not write errors to stderr direct
Browse files Browse the repository at this point in the history
This will break Tui

Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: 64b51901-28f8-4142-98d9-aadf7bcd66be
  • Loading branch information
rgrinberg committed Dec 12, 2022
1 parent 4dff505 commit 2d75445
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dune_rpc_impl/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
dune_stats
xdg
memo
dune_console
dune_util
dune_rpc_private
dune_rpc_server
Expand Down
1 change: 1 addition & 0 deletions src/dune_rpc_impl/import.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include Stdune
module Console = Dune_console
module Dune_rpc = Dune_rpc_private
module Build_system = Dune_engine.Build_system
3 changes: 2 additions & 1 deletion src/dune_rpc_impl/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ module Run = struct
in
let with_print_errors f () =
Fiber.with_error_handler f ~on_error:(fun exn ->
Format.eprintf "%a@." Exn_with_backtrace.pp_uncaught exn;
Dune_console.print
[ Pp.text "Uncaught RPC Error"; Exn_with_backtrace.pp exn ];
Exn_with_backtrace.reraise exn)
in
let run () =
Expand Down

0 comments on commit 2d75445

Please sign in to comment.