Skip to content

Default the error message of KustoServiceError if one is not provided.#628

Open
blalockma wants to merge 2 commits intoAzure:masterfrom
blalockma:master
Open

Default the error message of KustoServiceError if one is not provided.#628
blalockma wants to merge 2 commits intoAzure:masterfrom
blalockma:master

Conversation

@blalockma
Copy link

There are two locations that the exception KustoApiError is being raised in the base client:

The second case does not pass in a message param leading it to be an optional field. This is likely supposed to be handled by the OneApiError parsing here:

self.error = OneApiError.from_dict(error_dict["error"])

but the description field there is also optional:

This change contains:

  • Update the types of the function to be Optional so that the error is more obvious at dev-time.
  • Handling the situation of a None message by defaulting it to "Unknown Kusto service error"
  • Unit test to check the case shouldn't be failing anymore.

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.

2 participants