fix: unused variable and better error message

This commit is contained in:
Kjell Winblad 2024-06-07 12:20:42 +02:00
parent 2956e849eb
commit e63dcc84b0
1 changed files with 3 additions and 3 deletions

View File

@ -654,7 +654,7 @@ prepare_sql_to_conn(Conn, Prepares) ->
prepare_sql_to_conn(Conn, [], Statements, _Attempts) when is_pid(Conn) -> prepare_sql_to_conn(Conn, [], Statements, _Attempts) when is_pid(Conn) ->
{ok, Statements}; {ok, Statements};
prepare_sql_to_conn(Conn, [{Key, _} | _Rest], _Statements, _MaxAttempts = 2) when is_pid(Conn) -> prepare_sql_to_conn(Conn, [{_Key, _} | _Rest], _Statements, _MaxAttempts = 2) when is_pid(Conn) ->
failed_to_remove_prev_prepared_statement_error(); failed_to_remove_prev_prepared_statement_error();
prepare_sql_to_conn( prepare_sql_to_conn(
Conn, [{Key, {SQL, _RowTemplate}} | Rest] = ToPrepare, Statements, Attempts Conn, [{Key, {SQL, _RowTemplate}} | Rest] = ToPrepare, Statements, Attempts
@ -711,8 +711,8 @@ prepare_sql_to_conn(
failed_to_remove_prev_prepared_statement_error() -> failed_to_remove_prev_prepared_statement_error() ->
Msg = Msg =
("A previous prepared statement for the action already exists and " ("A previous prepared statement for the action already exists "
"we are not able to close it. Please, try to disable and then enable " "but cannot be closed. Please, try to disable and then enable "
"the connector to resolve this issue."), "the connector to resolve this issue."),
{error, unicode:charactes_to_binary(Msg)}. {error, unicode:charactes_to_binary(Msg)}.