Skip to content

Commit

Permalink
@monperrus at work
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Jun 13, 2020
1 parent 825c546 commit 740804c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/spoon/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,14 @@ public void prettyprint() {
try {
modelBuilder.generateProcessedSourceFiles(getEnvironment().getOutputType(), typeFilter);
} catch (Exception e) {
throw new SpoonException(e);
if (! (e instanceof SpoonException)) {
// contract: we encapuslate all Spoon exceptions into
// a single type
throw new SpoonException(e);
} else {
// don't wrap a SpoonException into another useless one
throw e;
}
}

if (!getEnvironment().getOutputType().equals(OutputType.NO_OUTPUT) && getEnvironment().isCopyResources()) {
Expand Down

0 comments on commit 740804c

Please sign in to comment.