Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Improve workflow-related exception reporting #18447

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/galaxy/managers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_object(trans, id, class_name, check_ownership=False, check_accessible=Fa
item = trans.sa_session.query(item_class).get(decoded_id)
assert item is not None
except Exception:
log.exception(f"Invalid {class_name} id ( {id} ) specified.")
log.warning(f"Invalid {class_name} id ( {id} ) specified.")
raise exceptions.MessageException(f"Invalid {class_name} id ( {id} ) specified", type="error")

if check_ownership or check_accessible:
Expand Down
8 changes: 6 additions & 2 deletions lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,10 +1856,14 @@ def __load_subworkflow_from_step_dict(
embedded_subworkflow = step_dict.get("subworkflow", None)
subworkflow_id = step_dict.get("content_id", None)
if embedded_subworkflow and subworkflow_id:
raise Exception("Subworkflow step defines both subworkflow and content_id, only one may be specified.")
raise exceptions.RequestParameterInvalidException(
"Subworkflow step defines both subworkflow and content_id, only one may be specified."
)

if not embedded_subworkflow and not subworkflow_id:
raise Exception("Subworkflow step must define either subworkflow or content_id.")
raise exceptions.RequestParameterInvalidException(
"Subworkflow step must define either subworkflow or content_id."
)

if embedded_subworkflow:
assert not dry_run
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7666,7 +7666,7 @@ def get_internal_version(self, version):
if version is None:
return self.latest_workflow
if len(self.workflows) <= version:
raise Exception("Version does not exist")
raise galaxy.exceptions.RequestParameterInvalidException("Version does not exist")
return list(reversed(self.workflows))[version]

def version_of(self, workflow):
Expand Down
Loading