fix: better error message for rule engine
This commit is contained in:
parent
634a2fb21d
commit
a284ab9cf8
|
@ -334,6 +334,11 @@ replace_sql_clrf(#{<<"sql">> := SQL} = Params) ->
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
err_msg({_, [{validation_error, VMessage}]}) ->
|
||||||
|
Exp = maps:get(expected_data_type, VMessage),
|
||||||
|
Path = maps:get(path, VMessage),
|
||||||
|
ErrorArg = maps:get(got, VMessage),
|
||||||
|
list_to_binary(io_lib:format("Key ~p error, expect ~p , got ~p", [Path, Exp, ErrorArg]));
|
||||||
err_msg(Msg) ->
|
err_msg(Msg) ->
|
||||||
list_to_binary(io_lib:format("~0p", [Msg])).
|
list_to_binary(io_lib:format("~0p", [Msg])).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue