docs: use "invalid" and "bad"

This commit is contained in:
Zaiming (Stone) Shi 2023-12-15 11:44:47 +01:00
parent 8018497d75
commit fc2ae4e5fa
3 changed files with 7 additions and 7 deletions

View File

@ -132,7 +132,7 @@ maps_key_take([K | Ks], M, Acc) ->
validate_listener_name(Name) -> validate_listener_name(Name) ->
try try
{match, _} = re:run(Name, "^[0-9a-zA-Z_-]+$"), {match, _} = re:run(Name, "^[a-zA-Z][0-9a-zA-Z_-]*$"),
ok ok
catch catch
_:_ -> _:_ ->
@ -140,7 +140,7 @@ validate_listener_name(Name) ->
{badconf, #{ {badconf, #{
key => name, key => name,
value => Name, value => Name,
reason => illegal_listener_name reason => bad_listener_name
}} }}
) )
end. end.

View File

@ -166,7 +166,7 @@ start_grpc_server(GwName, Options = #{bind := ListenOn}) ->
{badconf, #{ {badconf, #{
key => server, key => server,
value => Options, value => Options,
reason => illegal_grpc_server_confs reason => invalid_grpc_server_confs
}} }}
) )
end; end;
@ -175,7 +175,7 @@ start_grpc_server(_GwName, Options) ->
{badconf, #{ {badconf, #{
key => server, key => server,
value => Options, value => Options,
reason => illegal_grpc_server_confs reason => invalid_grpc_server_confs
}} }}
). ).
@ -196,7 +196,7 @@ start_grpc_client_channel(
{badconf, #{ {badconf, #{
key => address, key => address,
value => Address, value => Address,
reason => illegal_grpc_address reason => invalid_grpc_address
}} }}
) )
end, end,
@ -222,7 +222,7 @@ start_grpc_client_channel(_GwName, Options) ->
{badconf, #{ {badconf, #{
key => handler, key => handler,
value => Options, value => Options,
reason => ililegal_grpc_client_confs reason => invalid_grpc_client_confs
}} }}
). ).

View File

@ -250,7 +250,7 @@ init_state_and_channel([Req, Opts, _WsOpts], _State = undefined) ->
cowboy_req:parse_cookies(Req) cowboy_req:parse_cookies(Req)
catch catch
error:badarg -> error:badarg ->
?SLOG(error, #{msg => "illegal_cookie"}), ?SLOG(error, #{msg => "bad_cookie"}),
undefined; undefined;
Error:Reason -> Error:Reason ->
?SLOG(error, #{ ?SLOG(error, #{