diff --git a/lib/galaxy/managers/history_contents.py b/lib/galaxy/managers/history_contents.py index a0795391873..adf680ade8c 100644 --- a/lib/galaxy/managers/history_contents.py +++ b/lib/galaxy/managers/history_contents.py @@ -592,7 +592,7 @@ class HistoryContentsFilters( if val == "__null__": val = None if val not in ids: - raise KeyError(f"Could not find key {val} in object store keys {list(ids.keys())}") + raise ValueError(f"Could not find key {val} in object store keys {list(ids.keys())}") object_store_ids = ids[val] return sql.column("object_store_id").in_(object_store_ids) diff --git a/test/integration/test_quota.py b/test/integration/test_quota.py index 24928ef0e00..07137786a35 100644 --- a/test/integration/test_quota.py +++ b/test/integration/test_quota.py @@ -196,6 +196,13 @@ class TestQuotaIntegration(integration_util.IntegrationTestCase): labels = [q["quota_source_label"] for q in quotas] assert "mylabel" in labels + with self.dataset_populator.test_history() as history_id: + response = self.dataset_populator._get_contents_request( + history_id, data={"q": "quota_source_label-eq", "qv": "invalid", "v": "dev"} + ) + assert response.status_code == 400 + assert "unparsable value for filter" in response.json()["err_msg"] + def _create_quota_with_name(self, quota_name: str, is_default: bool = False): payload = self._build_quota_payload_with_name(quota_name, is_default) create_response = self._post("quotas", data=payload, json=True)