Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Catch all deserialization errors when deserializing error response models
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgyNTIxNC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.2.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgzMjcxMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.2.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand All @@ -47,4 +47,4 @@
"requirements.txt",
"generator/"
]
}
}
4 changes: 2 additions & 2 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgyNTIxNC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.2.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgzMjcxMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.2.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand Down Expand Up @@ -103,4 +103,4 @@
"chalk": "5.3.0",
"@types/fs-extra": "11.0.4"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1050,7 +1050,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def _failsafe_deserialize(
) -> typing.Any:
try:
return _deserialize(deserializer, response.json(), module, rf, format)
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand All @@ -1036,7 +1036,7 @@ def _failsafe_deserialize_xml(
) -> typing.Any:
try:
return _deserialize_xml(deserializer, response.text())
except DeserializationError:
except Exception: # pylint: disable=broad-except
_LOGGER.warning(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
Expand Down
Loading
Loading