mirror of
https://github.com/processone/ejabberd
synced 2025-10-02 17:29:27 +02:00
Fix some Elvis reports
This commit is contained in:
parent
1d5b9bba15
commit
4dea2f1eb6
2 changed files with 7 additions and 6 deletions
|
@ -16,6 +16,7 @@
|
|||
{elvis_style, function_naming_convention, disable},
|
||||
{elvis_style, god_modules, #{limit => 300}},
|
||||
{elvis_style, invalid_dynamic_call, disable},
|
||||
{elvis_style, macro_names, disable},
|
||||
{elvis_style, max_function_arity, disable}, % #{max_arity => 15}},
|
||||
{elvis_style, nesting_level, disable},
|
||||
{elvis_style, no_author, disable},
|
||||
|
|
|
@ -145,12 +145,12 @@ process([Call | _], #request{method = 'POST', data = Data, ip = IPPort} = Req) -
|
|||
%% TODO We need to refactor to remove redundant error return formatting
|
||||
throw:{error, unknown_command} ->
|
||||
json_format({404, 44, <<"Command not found.">>});
|
||||
_:{error,{_,invalid_json}} = _Err ->
|
||||
?DEBUG("Bad Request: ~p", [_Err]),
|
||||
_:{error,{_,invalid_json}} = Err ->
|
||||
?DEBUG("Bad Request: ~p", [Err]),
|
||||
badrequest_response(<<"Invalid JSON input">>);
|
||||
?EX_RULE(_Class, _Error, Stack) ->
|
||||
?EX_RULE(_Class, Error, Stack) ->
|
||||
StackTrace = ?EX_STACK(Stack),
|
||||
?DEBUG("Bad Request: ~p ~p", [_Error, StackTrace]),
|
||||
?DEBUG("Bad Request: ~p ~p", [Error, StackTrace]),
|
||||
badrequest_response()
|
||||
end;
|
||||
process([Call | _], #request{method = 'GET', q = Data, ip = {IP, _}} = Req) ->
|
||||
|
@ -166,9 +166,9 @@ process([Call | _], #request{method = 'GET', q = Data, ip = {IP, _}} = Req) ->
|
|||
%% TODO We need to refactor to remove redundant error return formatting
|
||||
throw:{error, unknown_command} ->
|
||||
json_format({404, 44, <<"Command not found.">>});
|
||||
?EX_RULE(_, _Error, Stack) ->
|
||||
?EX_RULE(_, Error, Stack) ->
|
||||
StackTrace = ?EX_STACK(Stack),
|
||||
?DEBUG("Bad Request: ~p ~p", [_Error, StackTrace]),
|
||||
?DEBUG("Bad Request: ~p ~p", [Error, StackTrace]),
|
||||
badrequest_response()
|
||||
end;
|
||||
process([_Call], #request{method = 'OPTIONS', data = <<>>}) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue