From fc2ae4e5fa21ea371aa4c6e20db6a61b54a03e52 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 15 Dec 2023 11:44:47 +0100 Subject: [PATCH] docs: use "invalid" and "bad" --- apps/emqx_gateway/src/emqx_gateway_conf.erl | 4 ++-- apps/emqx_gateway_exproto/src/emqx_gateway_exproto.erl | 8 ++++---- apps/emqx_gateway_ocpp/src/emqx_ocpp_connection.erl | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/emqx_gateway/src/emqx_gateway_conf.erl b/apps/emqx_gateway/src/emqx_gateway_conf.erl index 30c386f44..accd09a23 100644 --- a/apps/emqx_gateway/src/emqx_gateway_conf.erl +++ b/apps/emqx_gateway/src/emqx_gateway_conf.erl @@ -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. diff --git a/apps/emqx_gateway_exproto/src/emqx_gateway_exproto.erl b/apps/emqx_gateway_exproto/src/emqx_gateway_exproto.erl index 4b4c2337d..17180cdb6 100644 --- a/apps/emqx_gateway_exproto/src/emqx_gateway_exproto.erl +++ b/apps/emqx_gateway_exproto/src/emqx_gateway_exproto.erl @@ -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 }} ). diff --git a/apps/emqx_gateway_ocpp/src/emqx_ocpp_connection.erl b/apps/emqx_gateway_ocpp/src/emqx_ocpp_connection.erl index 6eadb169c..3147324f7 100644 --- a/apps/emqx_gateway_ocpp/src/emqx_ocpp_connection.erl +++ b/apps/emqx_gateway_ocpp/src/emqx_ocpp_connection.erl @@ -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, #{