diff --git a/src/future.ml b/src/future.ml index b21e3b74..1d803f1c 100644 --- a/src/future.ml +++ b/src/future.ml @@ -268,10 +268,24 @@ module Scheduler = struct flush oc ); if not exiting then begin - if output <> "" then - Printf.eprintf "Output[%d]:\n%s%!" job.id output; - handle_process_status job status; - Ivar.fill job.job.ivar () + match status with + | WEXITED 0 -> + if output <> "" then + Printf.eprintf "Output[%d]:\n%s%!" job.id output; + Ivar.fill job.job.ivar () + | WEXITED n -> + Printf.eprintf "\nCommand [%d] exited with code %d:\n$ %s\n%s%!" + job.id n + (strip_colors_for_stderr job.command_line) + (strip_colors_for_stderr output); + die "" + | WSIGNALED n -> + Printf.eprintf "\nCommand [%d] got signal %d:\n$ %s\n%s%!" + job.id n + (strip_colors_for_stderr job.command_line) + (strip_colors_for_stderr output); + die "" + | WSTOPPED _ -> assert false end let gen_id = diff --git a/src/main.ml b/src/main.ml index 355d3328..3a060ce3 100644 --- a/src/main.ml +++ b/src/main.ml @@ -32,6 +32,7 @@ let report_error ?(map_fname=fun x->x) ppf exn ~backtrace = "File \"%s\", line %d, characters %d-%d:\n\ Error: %s\n" (map_fname start.pos_fname) start.pos_lnum start_c stop_c msg + | Fatal_error "" -> () | Fatal_error msg -> Format.fprintf ppf "%s\n" (String.capitalize msg) | Findlib.Package_not_found pkg ->