-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Now showing integration errors when verbose is on #1630
Conversation
Using the self classloader so scripts can be their own integration? That's...not sure - either crazy or brilliant :) |
🙂 But why not? You might want to achieve something that you just can't do with regular code. I mean, the alternative is really hard: you would first need to turn the integration into a dependency published on Maven central before being able to use it. Also, we support But the real reason is that I was looking for an easy way to test integrations 😉 |
Ok, split PR in two, this one should now be a no-brainer to merge, it simply fixes #1499 and makes it possible to run external integrations when running inside an IDE, great for debugging, |
very weird issue ...first time I ran with this --verbose resulted in the final output to not be shown.
shows all the output but didn't actually run or at least not printed "Hello World!!" but I can't reliably reproduce it. wondering if there are a possible race condition on out put streams? |
@@ -267,6 +278,7 @@ public static void main(String... args) { | |||
IntegrationInput input = parser.fromJson(new InputStreamReader(System.in), IntegrationInput.class); | |||
ClassLoader old = Thread.currentThread().getContextClassLoader(); | |||
PrintStream oldout = System.out; | |||
Util.setVerbose(input.verbose); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this not be reversed afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in the case JBang itself is running the code this line is a no-op (it will be setting it to its current value) while in the case of external code the app will exit afterwards anyway.
also - i dont notice a difference.. got example to test with? |
Something has to go wrong, that's the only thing that should change. So instead of swallowing errors you should now be able to see them. Edit: Btw, that was the thing that the other PR was for: to be able to test this stuff 😉 |
Perhaps, I haven't ever seen it myself. But there's nothing in this PR that fools around with streams, so it might be an existing issue. |
needs rebasing |
Before the class loader would not be set up correctly because it expects to be running from an uber JAR with all the dependencies available. Now we specifically add the path to the Gson library in those cases. The user won't notice but it makes life easier for developers.
Done |
No description provided.