Skip to content

Commit

Permalink
log and raise exception without the try/catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Mar 15, 2024
1 parent b84f945 commit 441f9a7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/galaxy/webapps/galaxy/services/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 441f9a7

Please sign in to comment.