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(S, [], State).
|
||||||
|
|
||||||
parse_name([], Acc, State) ->
|
parse_name([], Acc, State) ->
|
||||||
% todo
|
throw({error, State#state.loc,
|
||||||
error;
|
"expected ')', found end of string"});
|
||||||
parse_name([$), T | S], Acc, State) ->
|
parse_name([$), T | S], Acc, State) ->
|
||||||
Type =
|
Type =
|
||||||
case T of
|
case T of
|
||||||
@ -186,13 +186,13 @@ parse_name([$), T | S], Acc, State) ->
|
|||||||
$s -> string;
|
$s -> string;
|
||||||
$b -> boolean;
|
$b -> boolean;
|
||||||
_ ->
|
_ ->
|
||||||
% todo
|
throw({error, State#state.loc,
|
||||||
error
|
["unknown type specifier '", T, "'"]})
|
||||||
end,
|
end,
|
||||||
{lists:reverse(Acc), Type, S, State};
|
{lists:reverse(Acc), Type, S, State};
|
||||||
parse_name([$) | _], Acc, State) ->
|
parse_name([$)], Acc, State) ->
|
||||||
% todo
|
throw({error, State#state.loc,
|
||||||
error;
|
"expected type specifier, found end of string"});
|
||||||
parse_name([C | S], Acc, State) ->
|
parse_name([C | S], Acc, State) ->
|
||||||
parse_name(S, [C | Acc], State).
|
parse_name(S, [C | Acc], State).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user