Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return value of leo_gateway_rest_api/handle_1 in case of error #47

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/leo_gateway_rest_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,12 @@ handle_1(Req, [{NumOfMinLayers, NumOfMaxLayers}, HasInnerCache, _CustomHeaderSet
threshold_of_chunk_len = Props#http_options.threshold_of_chunk_len},
handle_2(Req, HTTPMethod, Path, ReqParams, State);
false when HTTPMethod == ?HTTP_GET ->
?reply_not_found([?SERVER_HEADER], Path, <<>>, Req);
{ok, Req2} = ?reply_not_found([?SERVER_HEADER], Path, <<>>, Req),
{ok, Req2, State};
false ->
?reply_bad_request([?SERVER_HEADER], ?XML_ERROR_CODE_InvalidArgument,
?XML_ERROR_MSG_InvalidArgument, Path, <<>>, Req)
{ok, Req2} = ?reply_bad_request([?SERVER_HEADER], ?XML_ERROR_CODE_InvalidArgument,
?XML_ERROR_MSG_InvalidArgument, Path, <<>>, Req),
{ok, Req2, State}
end.

%% @private
Expand Down