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

feat: better error reporting #140

Merged
merged 29 commits into from
Dec 2, 2022
Merged

feat: better error reporting #140

merged 29 commits into from
Dec 2, 2022

Conversation

erdos
Copy link
Owner

@erdos erdos commented Nov 14, 2022

Make error messages more readable to help users. Tasks:

  • Generalize the use of EvalException and ParsingException. The Stencil API should throw only these two exceptions (and IOException in some cases).
  • Define a set of most common error cases
  • Add integration tests to check that meaningful error messages are displayed
  • Make sure meaningful error messages are propagated to the response in the service

Related to #139

Testing

Run locally with Leiningen as:

$ lein run path-to-template-docx-file path-to-a-json-payload-file

In case of error, process returns error code 4 and prints the improved error message (same that would be returned by the service).

@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Merging #140 (6633947) into master (a7dc048) will increase coverage by 0.23%.
The diff coverage is 90.47%.

@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
+ Coverage   92.03%   92.26%   +0.23%     
==========================================
  Files          26       26              
  Lines        1895     1900       +5     
  Branches      106      105       -1     
==========================================
+ Hits         1744     1753       +9     
+ Misses         45       42       -3     
+ Partials      106      105       -1     
Impacted Files Coverage Δ
src/stencil/infix.clj 88.39% <60.00%> (+1.10%) ⬆️
src/stencil/cleanup.clj 95.31% <100.00%> (+1.56%) ⬆️
src/stencil/eval.clj 97.36% <100.00%> (+0.22%) ⬆️
src/stencil/merger.clj 99.07% <100.00%> (+0.01%) ⬆️
src/stencil/model.clj 96.89% <100.00%> (-0.04%) ⬇️
src/stencil/tokenizer.clj 96.77% <100.00%> (ø)
src/stencil/util.clj 95.50% <100.00%> (+0.10%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@erdos erdos marked this pull request as ready for review December 2, 2022 13:21
@erdos erdos merged commit 92a7dab into master Dec 2, 2022
@erdos erdos deleted the feat-errhandling branch December 2, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax template language syntax tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant