Преглед изворни кода

docs: use "invalid" and "bad"

Zaiming (Stone) Shi пре 2 година
родитељ
комит
fc2ae4e5fa

+ 2 - 2
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.

+ 4 - 4
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
         }}
     ).
 

+ 1 - 1
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, #{