Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message for __EXTRACT_DATASETS__ tool
Provides a reasonable error message to users, instead of the internal error https://sentry.galaxyproject.org/share/issue/a197159192b64b9db065a762ee5dbbfc/: ``` KeyError: 'Dataset collection has no element_identifier with key 2.' File "galaxy/tools/__init__.py", line 1972, in handle_single_execution rval = self.execute( File "galaxy/tools/__init__.py", line 2069, in execute return self.tool_action.execute( File "galaxy/tools/actions/model_operations.py", line 88, in execute self._produce_outputs( File "galaxy/tools/actions/model_operations.py", line 119, in _produce_outputs tool.produce_outputs( File "galaxy/tools/__init__.py", line 3351, in produce_outputs extracted_element = collection[incoming["which"]["identifier"]] File "galaxy/model/__init__.py", line 6434, in __getitem__ raise KeyError(error_message) ``` Also makes the `identifier` parameter explicitly required (it is now inferred to be optional because text parameters are by default optional if no validator raises an exception upon validating an empty string). That prevents ``` KeyError: 'Dataset collection has no element_identifier with key None.' File "galaxy/tools/__init__.py", line 1972, in handle_single_execution rval = self.execute( File "galaxy/tools/__init__.py", line 2069, in execute return self.tool_action.execute( File "galaxy/tools/actions/model_operations.py", line 88, in execute self._produce_outputs( File "galaxy/tools/actions/model_operations.py", line 119, in _produce_outputs tool.produce_outputs( File "galaxy/tools/__init__.py", line 3351, in produce_outputs extracted_element = collection[incoming["which"]["identifier"]] File "galaxy/model/__init__.py", line 6434, in __getitem__ raise KeyError(error_message) ```
- Loading branch information