|
17 | 17 | ) |
18 | 18 | from azure.cli.core.commands import LongRunningOperation |
19 | 19 | from azure.cli.core.commands.progress import IndeterminateProgressBar |
| 20 | +from azure.core.exceptions import HttpResponseError |
20 | 21 | from azure.cli.core.profiles import ResourceType, get_sdk |
21 | 22 | from azure.cli.core.azclierror import AzCLIError, ResourceNotFoundError |
22 | 23 | from azure.core.polling import PollingMethod |
23 | 24 | from azure.mgmt.core.tools import parse_resource_id |
24 | 25 | from knack.log import get_logger |
25 | 26 | from enum import Enum |
26 | | -from msrestazure.azure_exceptions import CloudError |
27 | 27 |
|
28 | 28 |
|
29 | 29 | logger = get_logger(__name__) |
@@ -239,7 +239,7 @@ def process_taskrun(taskrun): |
239 | 239 | taskrun.task_log_result = tasklog |
240 | 240 | except ResourceNotFoundError as e: |
241 | 241 | logger.debug("Failed to get logs for taskrun: %s with exception: %s", taskrun.run_id, e) |
242 | | - except CloudError as e: |
| 242 | + except HttpResponseError as e: |
243 | 243 | logger.debug("An unexpected exception has occurred for taskrun: %s with exception: %s", |
244 | 244 | taskrun.run_id, e) |
245 | 245 |
|
@@ -439,7 +439,7 @@ def generate_logs(cmd, |
439 | 439 | registry_name=registry_name, |
440 | 440 | run_id=run_id) |
441 | 441 | log_file_sas = response.log_link |
442 | | - except (AttributeError, CloudError) as e: |
| 442 | + except (AttributeError, HttpResponseError) as e: |
443 | 443 | logger.debug("%s Exception: %s", error_msg, e) |
444 | 444 | raise AzCLIError(error_msg) |
445 | 445 | except ResourceNotFoundError as e: |
@@ -476,7 +476,7 @@ def get_run_status_local(client, resource_group_name, registry_name, run_id): |
476 | 476 | try: |
477 | 477 | response = client.get(resource_group_name, registry_name, run_id) |
478 | 478 | return response.status |
479 | | - except (AttributeError, CloudError): |
| 479 | + except (AttributeError, HttpResponseError): |
480 | 480 | return None |
481 | 481 |
|
482 | 482 | @staticmethod |
|
0 commit comments