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

View File

@ -166,7 +166,7 @@ start_grpc_server(GwName, Options = #{bind := ListenOn}) ->
{badconf, #{
key => server,
value => Options,
reason => illegal_grpc_server_confs
reason => invalid_grpc_server_confs
}}
)
end;
@ -175,7 +175,7 @@ start_grpc_server(_GwName, Options) ->
{badconf, #{
key => server,
value => Options,
reason => illegal_grpc_server_confs
reason => invalid_grpc_server_confs
}}
).
@ -196,7 +196,7 @@ start_grpc_client_channel(
{badconf, #{
key => address,
value => Address,
reason => illegal_grpc_address
reason => invalid_grpc_address
}}
)
end,
@ -222,7 +222,7 @@ start_grpc_client_channel(_GwName, Options) ->
{badconf, #{
key => handler,
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)
catch
error:badarg ->
?SLOG(error, #{msg => "illegal_cookie"}),
?SLOG(error, #{msg => "bad_cookie"}),
undefined;
Error:Reason ->
?SLOG(error, #{