From b449b8c735512ad909b28bd03f721685baf57088 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 6 Jun 2017 11:06:11 -0700 Subject: [PATCH] [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 --- infer/src/base/Config.ml | 6 +++--- infer/src/clang/ClangWrapper.re | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 3c51798cc..319899a2c 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -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 ; diff --git a/infer/src/clang/ClangWrapper.re b/infer/src/clang/ClangWrapper.re index ee9c166ae..093ab37f5 100644 --- a/infer/src/clang/ClangWrapper.re +++ b/infer/src/clang/ClangWrapper.re @@ -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;