fix(gateway): catch the error of invalid address

This commit is contained in:
firest 2022-06-13 10:58:43 +08:00
parent 1963441472
commit 2bab8884f9
1 changed files with 2 additions and 0 deletions

View File

@ -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",