Просмотр исходного кода

fix(gateway): catch the error of invalid address

firest 3 лет назад
Родитель
Сommit
2bab8884f9
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      apps/emqx_gateway/src/emqx_gateway_http.erl

+ 2 - 0
apps/emqx_gateway/src/emqx_gateway_http.erl

@@ -575,6 +575,8 @@ with_gateway(GwName0, Fun) ->
                 lists:join(".", lists:map(fun to_list/1, Path0))
             ),
             return_http_error(404, "Resource not found. path: " ++ Path);
+        error:{badmatch, {error, einval}} ->
+            return_http_error(400, "Invalid bind address");
         Class:Reason:Stk ->
             ?SLOG(error, #{
                 msg => "uncatched_error",