Improve rendering of errors
This commit is contained in:
parent
901d9acc2a
commit
aa5c4078f7
|
@ -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 =
|
||||
|
|
|
@ -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 ->
|
||||
|
|
Loading…
Reference in New Issue