aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2019-12-11 01:02:53 +0100
committerRoel Spilker <r.spilker@gmail.com>2019-12-11 01:02:53 +0100
commite510f918d044d47cb42d141e814e5a1e18bd9a12 (patch)
tree3c03e98a2ae6129cc23a57b81d410633a25b2db4
parenteabffab091f29b11562021c0c0cee155b22974f8 (diff)
downloadlombok-e510f918d044d47cb42d141e814e5a1e18bd9a12.tar.gz
lombok-e510f918d044d47cb42d141e814e5a1e18bd9a12.tar.bz2
lombok-e510f918d044d47cb42d141e814e5a1e18bd9a12.zip
Improve error message when post-compiler fails
-rw-r--r--src/core/lombok/core/PostCompiler.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lombok/core/PostCompiler.java b/src/core/lombok/core/PostCompiler.java
index 237867cb..e17f806e 100644
--- a/src/core/lombok/core/PostCompiler.java
+++ b/src/core/lombok/core/PostCompiler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2013 The Project Lombok Authors.
+ * Copyright (C) 2010-2019 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -45,7 +45,9 @@ public final class PostCompiler {
previous = next;
}
} catch (Exception e) {
- diagnostics.addWarning(String.format("Error during the transformation of '%s'; post-compiler '%s' caused an exception: %s", fileName, transformation.getClass().getName(), e));
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw, true));
+ diagnostics.addError(String.format("Error during the transformation of '%s'; post-compiler '%s' caused an exception: %s", fileName, transformation.getClass().getName(), sw));
}
}
return previous;
@@ -59,7 +61,7 @@ public final class PostCompiler {
transformations = Collections.emptyList();
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
- diagnostics.addWarning("Could not load post-compile transformers: " + e.getMessage() + "\n" + sw.toString());
+ diagnostics.addError("Could not load post-compile transformers: " + e.getMessage() + "\n" + sw.toString());
}
}