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

fix(tag): show source file in unformatted error message #5031

Merged
merged 2 commits into from Aug 13, 2022

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Aug 10, 2022

What does it do?

Error caused by the following example is not formatted by formatNunjucksError() (because err.message doesn't contain Line x, Column y), so the error message still shows (unknown path) which is not helpful. This PR replace it with source path.

{% test %}
${#var}
{% endtest %}

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@github-actions
Copy link

How to test

git clone -b template-error-source https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Aug 10, 2022

Coverage Status

Coverage decreased (-0.03%) to 98.009% when pulling fd882ab on curbengh:template-error-source into bbf09ac on hexojs:master.

curbengh added a commit to curbengh/hexo-site that referenced this pull request Aug 10, 2022
- some errors do not show affected line
- related to hexojs/hexo#5031
curbengh added a commit to curbengh/hexo-site that referenced this pull request Aug 10, 2022
- some errors do not show affected line
- related to hexojs/hexo#5031
@curbengh curbengh marked this pull request as draft August 11, 2022 05:52
@curbengh curbengh changed the title fix(tag): show source file in error stack fix(tag): show source file in unformatted error message Aug 11, 2022
@curbengh curbengh marked this pull request as ready for review August 11, 2022 06:15
@SukkaW SukkaW merged commit b48f095 into hexojs:master Aug 13, 2022
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