Restore compat with Autorest TestServer
This commit is contained in:
Родитель
8a0ef97f7e
Коммит
9134ffc997
|
@ -134,13 +134,17 @@ class HttpOperationError(ClientException):
|
|||
self.error = deserialize(resp_type, response)
|
||||
if self.error is None:
|
||||
self.error = deserialize.dependencies[resp_type]()
|
||||
# ARM uses OData v4
|
||||
# ARM uses OData v4, try that by default
|
||||
# http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
|
||||
# Code and Message are REQUIRED
|
||||
self.message = "({}) {}".format(
|
||||
self.error.error.code,
|
||||
self.error.error.message
|
||||
)
|
||||
try:
|
||||
self.message = "({}) {}".format(
|
||||
self.error.error.code,
|
||||
self.error.error.message
|
||||
)
|
||||
except AttributeError:
|
||||
# Try the default for Autorest if not available (compat)
|
||||
self.message = self.error.message
|
||||
except (DeserializationError, AttributeError, KeyError):
|
||||
pass
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче