Skip to content

Commit

Permalink
[JENKINS-21835] Don't print stacktrace. Print friendly log.
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaSha committed Oct 26, 2014
1 parent 6668d72 commit 14c313d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Expand Up @@ -76,7 +76,7 @@ protected CucumberTestResult parse(List<File> reportFiles, TaskListener listener
}
}
catch (CucumberModelException ccm) {
throw new IOException("Failed to parse Cucumber JSON", ccm);
throw new AbortException("Failed to parse Cucumber JSON: " + ccm.getMessage());
}
finally {
// even though this is a noop prevent an eclipse warning.
Expand Down
Expand Up @@ -98,8 +98,8 @@ public void feature(Feature feature) {
public void background(Background background) {
logger.fine("Background: " + background.getName());
if (currentBackground != null) {
logger.severe("Background received before previous background handled");
throw new CucumberModelException("Background received before previous background handled");
logger.severe("Background: " + background.getName() + " received before previous background: " + currentBackground.getName()+ " handled");
throw new CucumberModelException("Background: " + background.getName() + " received before previous background: " + currentBackground.getName()+ " handled");
}
currentBackground = new BackgroundResult(background);
}
Expand Down Expand Up @@ -152,8 +152,11 @@ public void step(Step step) {
// logger.fine(" " + step.getStackTraceElement());
}
if (currentStep != null) {
logger.severe("Step received before previous step handled!");
throw new CucumberModelException("Step received before previous step handled!");
logger.severe("Step: " + step.getKeyword() + " " + step.getName() + "received before previous step " +
step.getKeyword()+ " " +step.getName()+ " handled! Maybe caused by broken JSON, see #JENKINS-21835");
throw new CucumberModelException("Step: " + step.getKeyword() + " " + step.getName() +
"received before previous step " + step.getKeyword() + " " + step.getName() +
" handled! Maybe caused by broken JSON, see #JENKINS-21835");
}
currentStep = step;
}
Expand Down Expand Up @@ -243,8 +246,10 @@ public void match(Match match) {
// applies to a step.
logger.fine("rep match: " + match.getLocation());
if (currentMatch != null) {
logger.severe("Match received before previous Match handled");
throw new CucumberModelException("Match received before previous Match handled");
logger.severe("Match: " + match.getLocation() + " received before previous Match: " +
currentMatch.getLocation()+ "handled");
throw new CucumberModelException("Match: " + match.getLocation() + " received before previous Match: " +
currentMatch.getLocation()+ "handled");
}
currentMatch = match;
}
Expand Down

0 comments on commit 14c313d

Please sign in to comment.