-
Notifications
You must be signed in to change notification settings - Fork 121
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
Provide more detailed error message when env-script fails #463
Conversation
That's really great. Let me check the code out. |
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.
looks great. can we play with the output formatting a bit?
src/lib/environment/mod.rs
Outdated
"stdout: \"{}\"\n", | ||
"stderr: \"{}\"" |
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.
can we drop the wrapper " here? its a bit confusing in the output.
we can do
stdout:\n{}\n
stderr:\n{}\n
instead. wdyt?
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.
Sure, I couldn't really decide one ideal output format anyway.
src/lib/environment/mod.rs
Outdated
error!( | ||
concat!( | ||
"Error while evaluating script for env: {}, exit code: {}\n", | ||
"script: {:#?}\n", |
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.
can we change this one to
script:\n{:#?}\n
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.
Sure, np.
Codecov Report
@@ Coverage Diff @@
## 0.32.6 #463 +/- ##
===========================================
+ Coverage 64.91% 92.61% +27.70%
===========================================
Files 92 92
Lines 18049 18057 +8
===========================================
+ Hits 11717 16724 +5007
+ Misses 6332 1333 -4999
Continue to review full report at Codecov.
|
1bea729
to
3f42fdb
Compare
There is limited information given in the error output when an env-script return a non-zero exit code, which can be quite confusing as there is no context of where it failed (unless verbose output is turned on). Avoid confusion by providing more context about the environment when the script fails. BEFORE: > cargo make [cargo-make] INFO - cargo make 0.32.5 [cargo-make] ERROR - Error while executing command, exit code: 128 [cargo-make] WARN - Build Failed. AFTER: > cargo make [cargo-make] INFO - cargo make 0.32.5 [cargo-make] ERROR - Error while evaluating script for env: GIT_ROOT, exit code: 128 script: [ "git rev-parse --show-toplevel", ] stdout: stderr: fatal: not a git repository (or any of the parent directories): .git [cargo-make] WARN - Build Failed.
3f42fdb
to
76364b2
Compare
Looks great @epontan |
There is limited information given in the error output when an
env-script return a non-zero exit code, which can be quite confusing as
there is no context of where it failed (unless verbose output is turned
on).
Avoid confusion by providing more context about the environment when the
script fails.
BEFORE:
AFTER: