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

better error message for #327 #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 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
Loading