From 2bab8884f9674df0ba0d64fbe25968540705d7f1 Mon Sep 17 00:00:00 2001 From: firest Date: Mon, 13 Jun 2022 10:58:43 +0800 Subject: [PATCH] fix(gateway): catch the error of invalid address --- apps/emqx_gateway/src/emqx_gateway_http.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/emqx_gateway/src/emqx_gateway_http.erl b/apps/emqx_gateway/src/emqx_gateway_http.erl index 0165efed9..67228a31d 100644 --- a/apps/emqx_gateway/src/emqx_gateway_http.erl +++ b/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",