-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show detailed error #18229
show detailed error #18229
Conversation
(schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json)." | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be worth checking how this renders in sphinx (if it's actually in the public docs).
It may need additional code-block
tags for the formatting to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experiment, .. code-block:: tag will make the json invisible in sphinx
@@ -160,13 +181,14 @@ def error(self): | |||
return self | |||
|
|||
def __str__(self): | |||
return "({}) {}".format(self.code, self.message) | |||
return self.message_details() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is str()
also supposed to have a character limit? Or is that just repr()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't find there is a character limit in str()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in our guidelines - but looks to only be specified for repr
:
https://azure.github.io/azure-sdk/python_implementation.html#python-models-repr-length
So str might be okay?
Technically, yes. But given the issue is to update exception error message. I think it is acceptable? |
You could refactor it like this to make it otherwise unchanged: def __str__(self):
return "({}) {}\n{}".format(
self.code,
self.message
self.message_details()
)
def message_details(self):
"""
Original message_details method unchanged
"""
error_str = "Code: {}".format(self.code)
error_str += "\nMessage: {}".format(self.message)
... |
I thought about it :). But I felt a little weird if we show slightly different messages between str() & message_details(). I was concerned It would cause confusions. I will update my PR. |
…into azure_purview_catalog * 'master' of https://github.com/Azure/azure-sdk-for-python: (109 commits) [Tables] Adds support for AzureNamedKeyCredential (Azure#18456) [Tables] delete_entity takes an entity instead of row and partition key (Azure#18269) [Tables] Removed TableEntity attribute wrapper (Azure#18489) [EventHub&ServiceBus] Bump uAMQP dependency (Azure#17942) [ServiceBus] add keyword override support to update_ methods in mgmt module (Azure#18210) Add compatibility switch to disable CAE (Azure#18148) Service Bus Named Key Credential (Azure#18471) Change to use dynamic resource connection string for chat tests and identity samples (Azure#18502) Increase dependency (Azure#18500) show detailed error (Azure#18229) prerelease (Azure#18507) [Container Registry] addressing issues (Azure#18486) update per_call_policies & per_retry_policies (Azure#18406) Eh named key (Azure#18292) [Tables] Updating EntityProperty (Azure#18177) [Service Bus] fix async auth test (Azure#18499) [communication] Live Testing - Introduce CloudConfig into test.yml (Azure#18469) Release azure-servicefabric 8.0 (Azure#18488) [Communication]: Updated test_search_available_phone_numbers_with_invalid_country_code async test to be consistent with sync test (Azure#18466) [Container Registry] DeleteRepositoryResult Changed (Azure#18443) ...
update readme (Azure#18229) * update readme * Update readme.python.md * Update readme.python.md * Update readme.md Co-authored-by: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com>
No description provided.