Return HTTP 400 for GET /api/datasets/nonexistent_id

Previously it was returning HTTP status code 200 and the exception
message as content.
This commit is contained in:
Nicola Soranzo
2019-04-24 14:02:28 +01:00
parent 75ec6dba53
commit dbf33e7279
+1 -4
View File
@@ -126,10 +126,7 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin):
Displays information about and/or content of a dataset.
"""
# Get dataset.
try:
dataset = self.get_hda_or_ldda(trans, hda_ldda=hda_ldda, dataset_id=id)
except Exception as e:
return str(e)
dataset = self.get_hda_or_ldda(trans, hda_ldda=hda_ldda, dataset_id=id)
# Use data type to return particular type of data.
try: