Less redundant error message

This commit is contained in:
Hans Svensson 2019-09-05 15:28:03 +02:00
parent 47b3b9bcca
commit f07d1904ba
2 changed files with 2 additions and 3 deletions

View File

@ -76,7 +76,7 @@ file(File, Options0) ->
{ok, Bin} -> from_string(Bin, [{src_file, File} | Options]); {ok, Bin} -> from_string(Bin, [{src_file, File} | Options]);
{error, Error} -> {error, Error} ->
Msg = lists:flatten([File,": ",file:format_error(Error)]), Msg = lists:flatten([File,": ",file:format_error(Error)]),
Pos = aeso_errors:pos(File, 0, 0), Pos = aeso_errors:pos(0, 0),
{error, [aeso_errors:new(file_error, Pos, Msg)]} {error, [aeso_errors:new(file_error, Pos, Msg)]}
end. end.

View File

@ -35,8 +35,7 @@ simple_compile_test_() ->
[ {"Test file not found error", [ {"Test file not found error",
fun() -> fun() ->
{error, Errors} = aeso_compiler:file("does_not_exist.aes"), {error, Errors} = aeso_compiler:file("does_not_exist.aes"),
ExpErr = <<"In 'does_not_exist.aes' at line 0, col 0:\n" ExpErr = <<"does_not_exist.aes: no such file or directory">>,
"does_not_exist.aes: no such file or directory">>,
check_errors([ExpErr], Errors) check_errors([ExpErr], Errors)
end} ] ++ end} ] ++
[ {"Testing error messages of " ++ ContractName, [ {"Testing error messages of " ++ ContractName,