Skip to content

How to define a specific error message when checkIfExists of fromPath is failed #2515

Answered by manuelesimi
liuyang2006 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

You could check yourself if the path exists and return a custom message with the following code:

genome_path = file(genome_path)
if ( !genome_path.exists() )
    exit 1, "Genome path does not exist"

genome_ch = Channel.fromPath(genome_path, type: 'any')

Thanks,
manuele

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by manuelesimi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2511 on December 22, 2021 14:22.