Improve error diagnostic in driver init
This commit is contained in:
1
configure
vendored
1
configure
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
4
test.erl
4
test.erl
@@ -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}).
|
||||
|
||||
@@ -27,4 +27,4 @@ main(_) ->
|
||||
catch
|
||||
Class:Error ->
|
||||
io:format("~p:~p:~p~n", [Class, Error, erlang:get_stacktrace()])
|
||||
end.
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user