-
Notifications
You must be signed in to change notification settings - Fork 35
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
Plugin error should include output #113
Plugin error should include output #113
Conversation
@milton0825 thanks for catching this -- makes sense to me at first glance.. will go through some local testing after merging this into the pr branch & ping you if any questions pop up! |
@milton0825 - after running this against our test suite, the
This is accurate, according to what the function should return, but I'm wondering if it's useful in the current state. Do you anticipate a user to parse this programmatically? I don't mind spitting it out for debug purposes, but if the intention was to include the JSON so that it can be decoded by an error handler, we might need to dig a bit further. |
I think the message is useful in case we enter the codepath in: https://github.com/nilslice/protolock/pull/113/files#diff-46f2fc221fcb719cdbdbb78a314f6c64R85 when the plugin does not work properly and exit |
Ok, thanks. So the JSON added is a nice way to see the data the plugin was fed at a snapshot when the plugin failed? I'm good with that if it is helpful. |
Yeah that is helpful. Also in the case when there is a stackoverflow in the plugin, the stacktrace will be available through the output as it gathers both stdout and stderr. |
As a follow-on, do you think it would be more helpful if there was an easier way to guarantee that the output could be more easily parsed? Splitting the output with a
would enable the user to decode the message if they were to build in some programmatic handling or better reporting in their CI pipeline. it's probably not solving a known edge case, but I personally would like to be able to parse the output JSON from another tool if I pipe |
While we're in this part of the code, I may also change the output to read:
Switching the order of the error message so it is last, after the plugin name and then it's location on the system seems nicer.. |
Yeah I think we can make the error message easier to parse. |
Let me know if you have a better suggestion than the newline, otherwise I'm happy to implement and create a new PR with your changes included. |
When there is an error when executing the plugin, include the
stdin
andstdout
from output and log it