style: fix wording for nxdomain and malformed_username_or_password
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
This commit is contained in:
parent
8af3fb4ee7
commit
84fc64822e
|
@ -550,7 +550,7 @@ readable_error_msg(Error) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
to_hr_error(nxdomain) ->
|
to_hr_error(nxdomain) ->
|
||||||
<<"Host not found">>;
|
<<"Could not resolve host">>;
|
||||||
to_hr_error(econnrefused) ->
|
to_hr_error(econnrefused) ->
|
||||||
<<"Connection refused">>;
|
<<"Connection refused">>;
|
||||||
to_hr_error({unauthorized_client, _}) ->
|
to_hr_error({unauthorized_client, _}) ->
|
||||||
|
@ -558,7 +558,7 @@ to_hr_error({unauthorized_client, _}) ->
|
||||||
to_hr_error({not_authorized, _}) ->
|
to_hr_error({not_authorized, _}) ->
|
||||||
<<"Not authorized">>;
|
<<"Not authorized">>;
|
||||||
to_hr_error({malformed_username_or_password, _}) ->
|
to_hr_error({malformed_username_or_password, _}) ->
|
||||||
<<"Malformed username or password">>;
|
<<"Bad username or password">>;
|
||||||
to_hr_error(Error) ->
|
to_hr_error(Error) ->
|
||||||
iolist_to_binary(io_lib:format("~0p", [Error])).
|
iolist_to_binary(io_lib:format("~0p", [Error])).
|
||||||
|
|
||||||
|
|
|
@ -819,7 +819,7 @@ t_bridges_probe(Config) ->
|
||||||
emqx_json:decode(ConnRefused, [return_maps])
|
emqx_json:decode(ConnRefused, [return_maps])
|
||||||
),
|
),
|
||||||
|
|
||||||
{ok, 400, HostNotFound} = request(
|
{ok, 400, CouldNotResolveHost} = request(
|
||||||
post,
|
post,
|
||||||
uri(["bridges_probe"]),
|
uri(["bridges_probe"]),
|
||||||
?MQTT_BRIDGE(<<"nohost:2883">>)
|
?MQTT_BRIDGE(<<"nohost:2883">>)
|
||||||
|
@ -827,9 +827,9 @@ t_bridges_probe(Config) ->
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
#{
|
#{
|
||||||
<<"code">> := <<"TEST_FAILED">>,
|
<<"code">> := <<"TEST_FAILED">>,
|
||||||
<<"message">> := <<"Host not found">>
|
<<"message">> := <<"Could not resolve host">>
|
||||||
},
|
},
|
||||||
emqx_json:decode(HostNotFound, [return_maps])
|
emqx_json:decode(CouldNotResolveHost, [return_maps])
|
||||||
),
|
),
|
||||||
|
|
||||||
AuthnConfig = #{
|
AuthnConfig = #{
|
||||||
|
@ -873,7 +873,7 @@ t_bridges_probe(Config) ->
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
#{
|
#{
|
||||||
<<"code">> := <<"TEST_FAILED">>,
|
<<"code">> := <<"TEST_FAILED">>,
|
||||||
<<"message">> := <<"Malformed username or password">>
|
<<"message">> := <<"Bad username or password">>
|
||||||
},
|
},
|
||||||
emqx_json:decode(Malformed, [return_maps])
|
emqx_json:decode(Malformed, [return_maps])
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue