style: fix message returned for 404

Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
This commit is contained in:
Stefan Strigler 2022-11-08 12:49:45 +01:00 committed by Zaiming (Stone) Shi
parent 3eda28ba9c
commit 0678e05e84
2 changed files with 2 additions and 2 deletions

View File

@ -242,7 +242,7 @@ source(Method, #{bindings := #{type := Type} = Bindings} = Req) when
source(get, #{bindings := #{type := Type}}) -> source(get, #{bindings := #{type := Type}}) ->
case get_raw_source(Type) of case get_raw_source(Type) of
[] -> [] ->
{404, #{code => <<"NOT_FOUND">>, message => <<"Not found ", Type/binary>>}}; {404, #{code => <<"NOT_FOUND">>, message => <<"Not found: ", Type/binary>>}};
[#{<<"type">> := <<"file">>, <<"enable">> := Enable, <<"path">> := Path}] -> [#{<<"type">> := <<"file">>, <<"enable">> := Enable, <<"path">> := Path}] ->
case file:read_file(Path) of case file:read_file(Path) of
{ok, Rules} -> {ok, Rules} ->

View File

@ -183,7 +183,7 @@ t_api(_) ->
{ok, 404, ErrResult} = request(get, uri(["authorization", "sources", "http"]), []), {ok, 404, ErrResult} = request(get, uri(["authorization", "sources", "http"]), []),
?assertMatch( ?assertMatch(
#{<<"code">> := <<"NOT_FOUND">>, <<"message">> := <<"Not found http">>}, #{<<"code">> := <<"NOT_FOUND">>, <<"message">> := <<"Not found: http">>},
jsx:decode(ErrResult) jsx:decode(ErrResult)
), ),