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

1
configure vendored
View File

@@ -1803,6 +1803,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#AC_CONFIG_HEADERS([config.h])
#AC_CANONICAL_TARGET
# Checks for programs.
ac_ext=c

View File

@@ -5,6 +5,7 @@ AC_PREREQ([2.63])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([priv/erl_comm.c])
#AC_CONFIG_HEADERS([config.h])
#AC_CANONICAL_TARGET
# Checks for programs.
AC_PROG_CC

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.
%%--------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env escript
%%! -smp enable -pa ebin -name testsqlite3
%%! -smp enable -pa ebin -sname testsqlite3
-record(user, {name, age, wage}).