mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Better error handling in ejabberd_sql_pt
This commit is contained in:
parent
c58a4be6ee
commit
437e768e4a
@ -177,8 +177,8 @@ parse_name(S, State) ->
|
||||
parse_name(S, [], State).
|
||||
|
||||
parse_name([], Acc, State) ->
|
||||
% todo
|
||||
error;
|
||||
throw({error, State#state.loc,
|
||||
"expected ')', found end of string"});
|
||||
parse_name([$), T | S], Acc, State) ->
|
||||
Type =
|
||||
case T of
|
||||
@ -186,13 +186,13 @@ parse_name([$), T | S], Acc, State) ->
|
||||
$s -> string;
|
||||
$b -> boolean;
|
||||
_ ->
|
||||
% todo
|
||||
error
|
||||
throw({error, State#state.loc,
|
||||
["unknown type specifier '", T, "'"]})
|
||||
end,
|
||||
{lists:reverse(Acc), Type, S, State};
|
||||
parse_name([$) | _], Acc, State) ->
|
||||
% todo
|
||||
error;
|
||||
parse_name([$)], Acc, State) ->
|
||||
throw({error, State#state.loc,
|
||||
"expected type specifier, found end of string"});
|
||||
parse_name([C | S], Acc, State) ->
|
||||
parse_name(S, [C | Acc], State).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user