Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix exceptiont tests
  • Loading branch information
lmazuel committed Jul 31, 2019
commit 5facaefa7cf2a1c7b4c6f460af04c05c265aef5b
3 changes: 2 additions & 1 deletion sdk/core/azure-core/azure/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def __init__(self, response, **kwargs):

super(ODataV4Error, self).__init__(response=response, **kwargs)

self._error_format = "JSON was invalid for format " + str(self._ERROR_FORMAT) # type: Union[str, ODataV4Format]
self._error_format = None # type: Optional[Union[str, ODataV4Format]]
if self.odata_json:
try:
error_node = self.odata_json["error"]
Expand All @@ -273,6 +273,7 @@ def __init__(self, response, **kwargs):
)
except Exception: #pylint: disable=broad-except
_LOGGER.info("Received error message was not valid OdataV4 format.")
self._error_format = "JSON was invalid for format " + str(self._ERROR_FORMAT)

def __str__(self):
if self._error_format:
Expand Down