src/sqlite3.erl: remove unnecessary calls to error_logger (fix #10)

This commit is contained in:
booo
2012-06-14 18:11:23 +02:00
parent a95bb19811
commit 48568f0eaf

View File

@@ -1029,20 +1029,7 @@ do_sql_bind_and_exec(SQL, Params, #state{port = Port}) ->
do_sql_exec_script(SQL, #state{port = Port}) -> do_sql_exec_script(SQL, #state{port = Port}) ->
?dbgF("SQL: ~s~n", [SQL]), ?dbgF("SQL: ~s~n", [SQL]),
Results = exec(Port, {sql_exec_script, SQL}), exec(Port, {sql_exec_script, SQL}).
%% last element of Results may be an error
case Results of
[_|_] ->
case lists:last(Results) of
{error, _Code, Reason} ->
error_logger:error_msg("sqlite3 driver error: ~s~n",
[Reason]);
_ -> ok
end;
_ ->
ok
end,
Results.
exec(_Port, {create_function, _FunctionName, _Function}) -> exec(_Port, {create_function, _FunctionName, _Function}) ->
error_logger:error_report([{application, sqlite3}, "NOT IMPL YET"]); error_logger:error_report([{application, sqlite3}, "NOT IMPL YET"]);
@@ -1080,24 +1067,10 @@ exec(Port, {Cmd, Index}) when is_integer(Index) ->
wait_result(Port) -> wait_result(Port) ->
receive receive
{Port, Reply} -> {Port, Reply} ->
case Reply of Reply;
{error, Code, Reason} ->
error_logger:error_msg("sqlite3 driver error: ~s~n",
[Reason]),
% ?dbg("Error: ~p~n", [Reason]),
{error, Code, Reason};
_ ->
% ?dbg("Reply: ~p~n", [Reply]),
Reply
end;
{'EXIT', Port, Reason} -> {'EXIT', Port, Reason} ->
error_logger:error_msg("sqlite3 driver port closed with reason ~p~n",
[Reason]),
% ?dbg("Error: ~p~n", [Reason]),
{error, Reason}; {error, Reason};
Other when is_tuple(Other), element(1, Other) =/= '$gen_call', element(1, Other) =/= '$gen_cast' -> Other when is_tuple(Other), element(1, Other) =/= '$gen_call', element(1, Other) =/= '$gen_cast' ->
error_logger:error_msg("sqlite3 unexpected reply ~p~n",
[Other]),
Other Other
end. end.