Skip to content

fix: catch all requests exceptions in get_index to prevent unhandled NameResolutionError (closes #33691)#33775

Open
botbikamordehai2-sketch wants to merge 1 commit into
Azure:mainfrom
botbikamordehai2-sketch:fix/issue-33691-1784804830
Open

fix: catch all requests exceptions in get_index to prevent unhandled NameResolutionError (closes #33691)#33775
botbikamordehai2-sketch wants to merge 1 commit into
Azure:mainfrom
botbikamordehai2-sketch:fix/issue-33691-1784804830

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

The az find command crashes with an unhandled NameResolutionError when DNS resolution fails for the extension index endpoint (e.g., app.aladdin.microsoft.com returns NXDOMAIN). The exception is not caught by the existing except clause, causing a Python traceback instead of a user-friendly error.

Fix

Replace (requests.exceptions.ConnectionError, requests.exceptions.HTTPError, ValueError) with (requests.exceptions.RequestException, ValueError) in the get_index() function. RequestException is the base class for all exceptions raised by the requests library, including DNS resolution failures, connection errors, timeouts, and HTTP errors. This ensures any network-related error is caught and converted to a CLIError with a clear message.

Closes #33691

@botbikamordehai2-sketch
botbikamordehai2-sketch requested a review from a team as a code owner July 23, 2026 11:09
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @botbikamordehai2-sketch,
Usually we only allow pull requests to be submitted to the dev branch, please double check your pull request target branch main.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @botbikamordehai2-sketch,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@yonzhan
yonzhan requested a review from necusjz July 23, 2026 11:52
@yonzhan

yonzhan commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

az find

@necusjz

necusjz commented Jul 24, 2026

Copy link
Copy Markdown
Member

@botbikamordehai2-sketch thanks for your contribuation! however, it's covered by #33491 with a new backend service (will release in the next comming azure-cli version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants