From 543d663233d611003ac3a7e0645f74202c98588c Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 28 Sep 2024 14:45:16 +0200 Subject: [PATCH] [compiler] Print backtraces on `Failure` too. We keep the case as to not to disturbe the printing, but not sure it is worth it. --- compiler/bin-js_of_ocaml/js_of_ocaml.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/bin-js_of_ocaml/js_of_ocaml.ml b/compiler/bin-js_of_ocaml/js_of_ocaml.ml index 144543663c..a80b6ce41d 100644 --- a/compiler/bin-js_of_ocaml/js_of_ocaml.ml +++ b/compiler/bin-js_of_ocaml/js_of_ocaml.ml @@ -109,7 +109,9 @@ let () = comp; exit 1 | Failure s -> + let backtrace = Printexc.get_backtrace () in Format.eprintf "%s: Error: %s@." Sys.argv.(0) s; + prerr_string backtrace; exit 1 | exc -> let backtrace = Printexc.get_backtrace () in