Skip to content

[azure-core] Raise better error message for malformed endpoint #11048

@kristapratico

Description

@kristapratico

In reference to this issue: #9521

If the endpoint passed is malformed in some way, e.g. the https:// is chopped off, we get a cryptic message raised from azure.core :

File "C:\Users\krpratic\azure-sdk-for-python\env\lib\site-packages\azure\core\pipeline\transport\_base.py", line 695, in format_url
    base = self._base_url.format(**kwargs).rstrip("/")
KeyError: 'Endpoint'

KeyError should be raised with a better error message, e.g., like:

‘Failed to make service call. Did not understand the endpoint passed in: {some broken endpoint}. Please ensure that it is a valid URL’.

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions