Skip to content
Merged
Show file tree
Hide file tree
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 compiler/bin-jsoo_minify/jsoo_minify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ let main =
let t = Cmdliner.Term.(const f $ Cmd_arg.options) in
Cmdliner.Cmd.v Cmd_arg.info t

let (_ : int) =
let (exit_code : int) =
try Cmdliner.Cmd.eval ~catch:false ~argv:Sys.argv main with
| (Match_failure _ | Assert_failure _ | Not_found) as exc ->
let backtrace = Printexc.get_backtrace () in
Expand All @@ -101,10 +101,12 @@ let (_ : int) =
Sys.argv.(0);
Format.eprintf "Error: %s@." (Printexc.to_string exc);
prerr_string backtrace;
exit 1
1
| Failure s ->
Format.eprintf "%s: Error: %s@." Sys.argv.(0) s;
exit 1
1
| exc ->
Format.eprintf "%s: Error: %s@." Sys.argv.(0) (Printexc.to_string exc);
exit 1
1

let () = exit exit_code
10 changes: 6 additions & 4 deletions compiler/bin-wasm_of_ocaml/wasmoo_link_wasm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

open Js_of_ocaml_compiler.Stdlib

let (_ : int) =
let (exit_code : int) =
try Cmdliner.Cmd.eval ~catch:false ~argv:Sys.argv Link_wasm.command with
| (Match_failure _ | Assert_failure _ | Not_found) as exc ->
let backtrace = Printexc.get_backtrace () in
Expand All @@ -29,10 +29,12 @@ let (_ : int) =
Sys.argv.(0);
Format.eprintf "Error: %s@." (Printexc.to_string exc);
prerr_string backtrace;
exit 1
1
| Failure s ->
Format.eprintf "%s: Error: %s@." Sys.argv.(0) s;
exit 1
1
| exc ->
Format.eprintf "%s: Error: %s@." Sys.argv.(0) (Printexc.to_string exc);
exit 1
1

let () = exit exit_code
Loading