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
4 changes: 3 additions & 1 deletion replicate/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class ModelError(ReplicateException):

def __init__(self, prediction: "Prediction") -> None:
self.prediction = prediction
super().__init__(prediction.error)
super().__init__(
f"Prediction {prediction.id} {prediction.status}: {prediction.error}"
)


class ReplicateError(ReplicateException):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ async def test_run_with_model_error(mock_replicate_api_token):
},
)

assert str(excinfo.value) == "OOM"
assert str(excinfo.value) == "Prediction p1 failed: OOM"
assert excinfo.value.prediction.error == "OOM"
assert excinfo.value.prediction.status == "failed"

Expand Down