From 3c695ba71c87955f9303151b3b77cab64325fe40 Mon Sep 17 00:00:00 2001 From: Piotr Faba Date: Wed, 27 May 2020 18:00:47 +0200 Subject: [PATCH 1/2] test error display --- conf/bi.config | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/bi.config b/conf/bi.config index 0ad15d4..b96c8e9 100644 --- a/conf/bi.config +++ b/conf/bi.config @@ -10,6 +10,7 @@ includeConfig params.globalConfig def determine_global_config() { if( System.getenv('NXF_GLOBAL_CONFIG') == null) { + System.err.println("Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file") throw new Exception("Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file") } return System.getenv('NXF_GLOBAL_CONFIG') From f139750bf442aefcefe6d9588206037c92757ba5 Mon Sep 17 00:00:00 2001 From: Piotr Faba Date: Wed, 27 May 2020 19:14:43 +0200 Subject: [PATCH 2/2] print the error message before throwing Exception --- conf/bi.config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/bi.config b/conf/bi.config index b96c8e9..f9dfb27 100644 --- a/conf/bi.config +++ b/conf/bi.config @@ -10,8 +10,9 @@ includeConfig params.globalConfig def determine_global_config() { if( System.getenv('NXF_GLOBAL_CONFIG') == null) { - System.err.println("Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file") - throw new Exception("Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file") + def errorMessage = "ERROR: Environment variable NXF_GLOBAL_CONFIG is missing. Set it to point to global.config file." + System.err.println(errorMessage) + throw new Exception(errorMessage) } return System.getenv('NXF_GLOBAL_CONFIG') }