[wibble] refactor error output

Summary: Also makes the error message for clang commands a bit nicer to the eye.

Reviewed By: mbouaziz

Differential Revision: D5191664

fbshipit-source-id: 801ec72
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 6435e6b001
commit b449b8c735

@ -1706,9 +1706,9 @@ let post_parsing_initialization command_opt =
Caml.Printexc.set_uncaught_exception_handler
(fun exn _ ->
let exn_msg = match exn with
| Failure msg -> "ERROR: " ^ msg
| _ -> "ERROR: " ^ Caml.Printexc.to_string exn in
Format.eprintf "%s@?" exn_msg
| Failure msg -> msg
| _ -> Caml.Printexc.to_string exn in
Format.eprintf "ERROR: %s@." exn_msg
);
F.set_margin !margin ;

@ -128,7 +128,7 @@ let exec_action_item =
/* An error in the output of `clang -### ...`. Outputs the error and fail. This is because
`clang -###` pretty much never fails, but warns of failures on stderr instead. */
failwithf
"@\n*** ERROR: Failed to execute compilation command. Output:@\n%s@\n*** Infer needs a working compilation command to run.@."
"Failed to execute compilation command. Output:@\n%s@\n*** Infer needs a working compilation command to run."
error
| ClangWarning warning => L.external_warning "%s@\n" warning
| Command clang_cmd => Capture.capture clang_cmd;

Loading…
Cancel
Save