Improve error diagnostic in driver init

This commit is contained in:
sergey-miryanov
2010-02-11 14:41:55 +05:00
parent 27169869c0
commit cd10c3eea0
4 changed files with 6 additions and 4 deletions

View File

@@ -396,8 +396,8 @@ init(Options) ->
Port = open_port({spawn, string:join ([atom_to_list (?DRIVER_NAME), Dbase], " ")}, [binary]),
{ok, #state{port = Port, ops = Options}};
{error, Error} ->
io:format("Error loading ~p: ~p", [?DRIVER_NAME, erl_ddll:format_error(Error)]),
{stop, failed}
Msg = io_lib:format("Error loading ~p: ~p", [?DRIVER_NAME, erl_ddll:format_error(Error)]),
{stop, lists:flatten (Msg)}
end.
%%--------------------------------------------------------------------