Skip to content

Commit

Permalink
better error message for #327
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Aug 5, 2024
1 parent 1c6a973 commit 361489f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "stimela"
version = "2.0.1"
description = "Framework for system agnostic pipelines for (not just) radio interferometry"
authors = ["Sphesihle Makhathini <sphemakh@gmail.com>", "Oleg Smirnov and RATT <osmirnov@gmail.com>"]
authors = ["Oleg Smirnov and RATT <osmirnov@gmail.com>", "Sphesihle Makhathini <sphemakh@gmail.com>"]
readme = "README.rst"
license = "GNU GPL v2"
include = [{ path = "tests" }]
Expand Down
12 changes: 9 additions & 3 deletions stimela/commands/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from scabha.cargo import ParameterCategory
from stimela.kitchen.recipe import Recipe
from stimela.kitchen.cab import Cab
from stimela.exceptions import RecipeValidationError
from stimela.exceptions import RecipeValidationError, CabValidationError
from stimela.task_stats import destroy_progress_bar

from .run import load_recipe_files, resolve_recipe_file
Expand Down Expand Up @@ -122,8 +122,14 @@ def load_recipe(name: str, section: Dict):
recipe.rich_help(tree, max_category=max_category)

for name in cabs_to_document:
cab = Cab(**stimela.CONFIG.cabs[name])
cab.finalize(config=stimela.CONFIG)
try:
cab = Cab(**stimela.CONFIG.cabs[name])
cab.finalize(config=stimela.CONFIG)
except Exception as exc:
if not isinstance(exc, CabValidationError):
exc = CabValidationError(f"error loading cab '{name}'", exc)
log_exception(exc)
sys.exit(2)
tree = top_tree.add(f"Cab: [bold]{name}[/bold]")
cab.rich_help(tree, max_category=max_category)

Expand Down

0 comments on commit 361489f

Please sign in to comment.