Merge pull request #8191 from lafirest/fix/gateway_address_error

fix(gateway): catch the error of invalid address
This commit is contained in:
JianBo He 2022-06-13 14:32:01 +08:00 committed by GitHub
commit b14998ea7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",