We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4dd898 + 5f82fee commit 9615b60Copy full SHA for 9615b60
2 files changed
src/vws/exceptions.py
@@ -206,6 +206,16 @@ def response(self) -> Response:
206
"""
207
return self._response
208
209
+ @property
210
+ def target_id(self) -> str:
211
+ """
212
+ The processing target ID.
213
214
+ path = urlparse(self.response.url).path
215
+ # Every HTTP path which can raise this error is in the format
216
+ # `/something/{target_id}`.
217
+ return path.split(sep='/', maxsplit=2)[-1]
218
+
219
220
class ProjectInactive(Exception):
221
tests/test_exceptions.py
@@ -210,6 +210,7 @@ def test_target_status_processing(
vws_client.delete_target(target_id=target_id)
assert exc.value.response.status_code == codes.FORBIDDEN
+ assert exc.value.target_id == target_id
def test_metadata_too_large(
0 commit comments