From b22ecf19e81baac844878afd896ebbdda4266a84 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Tue, 26 Mar 2013 12:54:16 +0000 Subject: Improve Dialyzer output for scan errors To reproduce, create an empty file "foo.erl" and run dialyzer on it. Results without this patch: $ dialyzer --src /tmp/foo.erl Checking whether the PLT /Users/magnus/.dialyzer_r16_plt is up-to-date... yes Proceeding with analysis... dialyzer: Analysis failed with error: Could not scan the following file(s): [{"/tmp/foo.erl", ["/tmp/foo.erl:1: no module definition\n"]}] Last messages in the log cache: Reading files and computing callgraph... Results with this patch: $ dialyzer --src /tmp/foo.erl Checking whether the PLT /Users/magnus/.dialyzer_r16_plt is up-to-date... yes Proceeding with analysis... dialyzer: Analysis failed with error: Could not scan the following file(s): /tmp/foo.erl:1: no module definition Last messages in the log cache: Reading files and computing callgraph... --- lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index 86618a4915..ca6b403ac9 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -261,8 +261,8 @@ compile_and_store(Files, #analysis_state{codeserver = CServer, dict:new(), NewFiles), check_for_duplicate_modules(ModDict); false -> - Msg = io_lib:format("Could not scan the following file(s): ~p", - [lists:flatten(Failed)]), + Msg = io_lib:format("Could not scan the following file(s):~n~s", + [[Reason || {_Filename, Reason} <- Failed]]), exit({error, Msg}) end, {T2, _} = statistics(runtime), -- cgit v1.2.3