From e00233c889a7ef28e1897235cc633513ac4cd52c Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Thu, 8 Apr 2021 16:17:55 -0400 Subject: [PATCH] catch general exception, remove azure.core import (#17908) --- .../azure-sdk-tools/devtools_testutils/resource_testcase.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/resource_testcase.py b/tools/azure-sdk-tools/devtools_testutils/resource_testcase.py index f865406d062b..5ff7ff56a62c 100644 --- a/tools/azure-sdk-tools/devtools_testutils/resource_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/resource_testcase.py @@ -11,8 +11,6 @@ import logging from functools import partial -from azure.core.exceptions import HttpResponseError - from azure_devtools.scenario_tests import AzureTestError, ReservedResourceNameError from azure.mgmt.resource import ResourceManagementClient @@ -112,9 +110,9 @@ def remove_resource(self, name, **kwargs): raise AzureTestError("Timed out waiting for resource group to be deleted.") else: self.client.resource_groups.begin_delete(name, polling=False) - except HttpResponseError as err: + except Exception as err: # NOTE: some track 1 libraries do not have azure-core installed. Cannot use HttpResponseError here logging.info("Failed to delete resource group with name {}".format(name)) - logging.info("{}".format(err.response)) + logging.info("{}".format(err)) pass