Skip to content
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

Improve logs when failing to parse external descriptor #475

Merged
merged 1 commit into from Oct 15, 2020
Merged

Improve logs when failing to parse external descriptor #475

merged 1 commit into from Oct 15, 2020

Conversation

mrmanne
Copy link
Contributor

@mrmanne mrmanne commented Oct 14, 2020

cargo-make currently panics when failing to parse an external
descriptor. The panic log is quite confusing since it doesn't tell
which file that caused the error.

Log the name of the file that couldn't be parsed. Add a corresponding
error log before the panic call to force a clean exit(1) instead of
panic.

BEFORE:
$ cargo make
[cargo-make] INFO - cargo make 0.32.7
thread 'main' panicked at 'Unable to parse external descriptor,
unexpected character found: \\ at line 1 column 1',
src/lib/descriptor/mod.rs:378:27
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

AFTER:
$ cargo make
[cargo-make] INFO - cargo make 0.32.7
[cargo-make] ERROR - Unable to parse external file: "./test.toml",
unexpected character found: \\ at line 1 column 1
[cargo-make] WARN - Build Failed.

cargo-make currently panics when failing to parse an external
descriptor. The panic log is quite confusing since it doesn't tell
which file that caused the error.

Log the name of the file that couldn't be parsed. Add a corresponding
error log before the panic call to force a clean exit(1) instead of
panic.

BEFORE:
$ cargo make
[cargo-make] INFO - cargo make 0.32.7
thread 'main' panicked at 'Unable to parse external descriptor,
  unexpected character found: `\\` at line 1 column 1',
  src/lib/descriptor/mod.rs:378:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

AFTER:
$ cargo make
[cargo-make] INFO - cargo make 0.32.7
[cargo-make] ERROR - Unable to parse external file: "./test.toml",
  unexpected character found: `\\` at line 1 column 1
[cargo-make] WARN - Build Failed.
@codecov-io
Copy link

codecov-io commented Oct 14, 2020

Codecov Report

Merging #475 into master will decrease coverage by 0.01%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
- Coverage   93.10%   93.08%   -0.02%     
==========================================
  Files          92       92              
  Lines       18058    18064       +6     
==========================================
+ Hits        16812    16814       +2     
- Misses       1246     1250       +4     
Impacted Files Coverage Δ
src/lib/descriptor/mod.rs 86.04% <62.50%> (-0.79%) ⬇️
src/lib/environment/crateinfo.rs 83.72% <0.00%> (-0.59%) ⬇️
src/lib/runner.rs 81.14% <0.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc4b969...caeae05. Read the comment docs.

@sagiegurari sagiegurari changed the base branch from master to 0.32.8 October 15, 2020 05:16
@sagiegurari
Copy link
Owner

@mrmanne thanks a lot for the PR.
This looks great. merging it to a new development branch.

@sagiegurari sagiegurari merged commit 22ab154 into sagiegurari:0.32.8 Oct 15, 2020
@mrmanne mrmanne deleted the improved_error_message branch October 15, 2020 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants