Skip to content

Commit

Permalink
Better error when app version is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Feb 6, 2025
1 parent 2935e04 commit 19949a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bfabric_app_runner/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
symlinks instead of copying the file, as needed.
- `BfabricOrderFastaSpec.required` which allows specifying whether the order fasta is required or not

### Changed

- Better error when app version is not found.

## \[0.0.14\] - 2025-01-30

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def resolve_app(versions: AppSpec, workunit_definition: WorkunitDefinition) -> A
raise ValueError("The workunit definition does not contain an application version.")
app_version = workunit_definition.execution.raw_parameters["application_version"]
# TODO graceful handling of invalid versions
if app_version in versions and versions[app_version] is not None:
return app_version
else:
msg = (
f"application_version '{app_version}' is not defined in the app spec,\n"
f" available versions: {sorted(versions.keys())}"
)
raise ValueError(msg)
return versions[app_version]


Expand Down

0 comments on commit 19949a6

Please sign in to comment.