Improved error handling in test pipelines.

Change-Id: Iecd0451fa776c2238e65672269c1ac2a6c734baf
diff --git a/test-groovy-pipeline.groovy b/test-groovy-pipeline.groovy
index 71e9fc0..edd549a 100644
--- a/test-groovy-pipeline.groovy
+++ b/test-groovy-pipeline.groovy
@@ -38,7 +38,7 @@
               checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, defaultGitRef, "HEAD", CREDENTIALS_ID)
           }
           if(!checkouted){
-            common.errorMsg("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
+            throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
           }
         }
         stage ('Run Codenarc tests'){