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

Catch AssertionError from schema build #1267

Merged
merged 4 commits into from
Nov 16, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Fixed bug in `nf-core list` when `NXF_HOME` is set
* Run CI test used to create and lint/run the pipeline template with minimum and latest edge release of NF ([#1304](https://github.com/nf-core/tools/issues/1304))
* New YAML issue templates for tools bug reports and feature requests, with a much richer interface ([#1165](https://github.com/nf-core/tools/pull/1165))
* Handle synax errors in Nextflow config nicely when running `nf-core schema build` ([#1267](https://github.com/nf-core/tools/pull/1267))

### Modules

Expand Down
2 changes: 1 addition & 1 deletion nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def build(dir, no_prompts, web_only, url):
schema_obj = nf_core.schema.PipelineSchema()
if schema_obj.build_schema(dir, no_prompts, web_only, url) is False:
sys.exit(1)
except UserWarning as e:
except (UserWarning, AssertionError) as e:
log.error(e)
sys.exit(1)

Expand Down
2 changes: 1 addition & 1 deletion nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def nextflow_cmd(cmd):
raise AssertionError("It looks like Nextflow is not installed. It is required for most nf-core functions.")
except subprocess.CalledProcessError as e:
raise AssertionError(
f"Command '{cmd}' returned non-zero error code '{e.returncode}':\n[red]> {e.stderr.decode()}"
f"Command '{cmd}' returned non-zero error code '{e.returncode}':\n[red]> {e.stderr.decode()}{e.stdout.decode()}"
)


Expand Down