Skip to content

Commit e9f92bc

Browse files
authored
[Containerapp] Fix #31480: az containerapp revision copy: Only return containerapp does not exist when got 404 (#31689)
1 parent 582b673 commit e9f92bc

File tree

1 file changed

+4
-3
lines changed
  • src/azure-cli/azure/cli/command_modules/containerapp

1 file changed

+4
-3
lines changed

src/azure-cli/azure/cli/command_modules/containerapp/custom.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from .containerapp_env_decorator import ContainerAppEnvDecorator, ContainerAppEnvCreateDecorator, ContainerAppEnvUpdateDecorator
3535
from .containerapp_auth_decorator import ContainerAppAuthDecorator
3636
from .containerapp_decorator import ContainerAppCreateDecorator, BaseContainerAppDecorator
37-
from ._client_factory import handle_raw_exception, handle_non_resource_not_found_exception
37+
from ._client_factory import handle_raw_exception, handle_non_resource_not_found_exception, \
38+
handle_non_404_status_code_exception
3839
from ._clients import (
3940
ManagedEnvironmentClient,
4041
ContainerAppClient,
@@ -369,8 +370,8 @@ def update_containerapp_logic(cmd,
369370
containerapp_def = None
370371
try:
371372
containerapp_def = ContainerAppClient.show(cmd=cmd, resource_group_name=resource_group_name, name=name)
372-
except:
373-
pass
373+
except Exception as e:
374+
handle_non_404_status_code_exception(e)
374375

375376
if not containerapp_def:
376377
raise ResourceNotFoundError("The containerapp '{}' does not exist".format(name))

0 commit comments

Comments
 (0)