Skip to content

Commit

Permalink
Merge pull request #1267 from nf-core/ewels-patch-1
Browse files Browse the repository at this point in the history
Catch AssertionError from schema build
  • Loading branch information
ewels authored Nov 16, 2021
2 parents ffab773 + a135b8e commit bc8e01c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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

0 comments on commit bc8e01c

Please sign in to comment.