Improved error handling in test pipelines.

Change-Id: Iecd0451fa776c2238e65672269c1ac2a6c734baf
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index 05695b2..d43c217 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -49,7 +49,7 @@
           ssh.agentSh("git submodule init; git submodule sync; git submodule update --recursive")
         }
       }else{
-        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("test") {