You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kvdb_sqlite3.erl, or other modules using functions in this module, might crash since there is a faulty presumption that error codes returned from sqlite3 has the format {error, Error}, for example in kvdb_sqlite3.erl, line 231 (function put):
{error,_} = Error ->
Error
Investigation into sqlite3 shows that there is another possible error format, {error, integer(), string()}:
%% @type sqlite_error() = {'error', integer(), string()} | {'error', any()}.
%% @type sql_result() = sql_non_query_result() | [{columns, [string()]} | {rows, [tuple()]} | sqlite_error()].
A solution could be wrapping all calls to sqlite3 in a function somewhat like this:
%% Need to convert error result
sqlite_call(M,F,Args) ->
case M:F(Args) of
{error, Int, String} -> {error, {Int, String}};
Other -> Other
end.
The text was updated successfully, but these errors were encountered:
kvdb_sqlite3.erl, or other modules using functions in this module, might crash since there is a faulty presumption that error codes returned from sqlite3 has the format {error, Error}, for example in kvdb_sqlite3.erl, line 231 (function put):
{error,_} = Error ->
Error
Investigation into sqlite3 shows that there is another possible error format, {error, integer(), string()}:
%% @type sqlite_error() = {'error', integer(), string()} | {'error', any()}.
%% @type sql_result() = sql_non_query_result() | [{columns, [string()]} | {rows, [tuple()]} | sqlite_error()].
A solution could be wrapping all calls to sqlite3 in a function somewhat like this:
%% Need to convert error result
sqlite_call(M,F,Args) ->
case M:F(Args) of
{error, Int, String} -> {error, {Int, String}};
Other -> Other
end.
The text was updated successfully, but these errors were encountered: