From 441f9a77c3fb31ce2da669e2649140154678c9ae Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Fri, 15 Mar 2024 15:55:10 -0500 Subject: [PATCH] log and raise exception without the `try/catch` block --- lib/galaxy/webapps/galaxy/services/datasets.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/services/datasets.py b/lib/galaxy/webapps/galaxy/services/datasets.py index d08fb1a7f33d..bafb1922bd01 100644 --- a/lib/galaxy/webapps/galaxy/services/datasets.py +++ b/lib/galaxy/webapps/galaxy/services/datasets.py @@ -983,10 +983,9 @@ def _raw_data( return data def _get_indexer(self, trans, dataset): - try: - indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index") - if indexer is None: - raise Exception("No indexer available for this dataset") - return indexer - except Exception as e: - raise galaxy_exceptions.ObjectNotFound(f"Error getting indexer: {util.unicodify(e)}") + indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index") + if indexer is None: + msg = f"No indexer available for dataset {self.encode_id(dataset.id)}" + log.exception(msg) + raise galaxy_exceptions.ObjectNotFound(msg) + return indexer