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

Better error message #1771

Closed
leesei opened this issue Feb 23, 2016 · 10 comments
Closed

Better error message #1771

leesei opened this issue Feb 23, 2016 · 10 comments
Labels
enhancement New feature or request

Comments

@leesei
Copy link
Member

leesei commented Feb 23, 2016

It helps the user identify and fix errors if we

  • throw sensible errors
  • print warnings more verbosely.

Do comment if you found some area that needs improving.


EDIT I have a WIP branch here:
https://github.com/leesei/hexo/commits/better-error-message

To use this branch:

npm i leesei/hexo#better-error-message
@leesei
Copy link
Member Author

leesei commented Feb 23, 2016

slug not found

Hexo fails silently upon this:
#1562
#1594

Test all tag plugins and check how they handle space
hexo cannot use space within tag plugin arguments | Life & Note - winterTTr
Add test cases

@leesei
Copy link
Member Author

leesei commented Feb 23, 2016

_config.yaml

YAML is quite strict in its format and Hexo does not report YAML parsing error properly.
We should catch parsing error early, log and abort the operation.

hexojs/hexo-deployer-git#15
#1263
#11

add resource like:

@leesei leesei added the enhancement New feature or request label Feb 23, 2016
@leesei
Copy link
Member Author

leesei commented Feb 23, 2016

Missing theme

#1658

@leesei
Copy link
Member Author

leesei commented Feb 23, 2016

Better trace of invalid tag

The erroneous tag/syntax causing Nunjunk/Swig error are not easy to read. The line and column refer to intermediate HTML generated from MD.


unexpected token

`docker ps -aq | map docker inspect -f "{{.Name}} {{.Mounts}}"`

Done, see https://github.com/leesei/hexo/commit/ebb81a9b1f4617e32b1af4ad27b5c56270c0cbfc

screenshot-2016-04-11-222638


unknown block tag

{% abc %}
alert('Hello World!');
{% endabc %}

Done, see https://github.com/leesei/hexo/commit/ebb81a9b1f4617e32b1af4ad27b5c56270c0cbfc

screenshot-2016-04-11-223953


unexpected end of file

{% codeblock %}
alert('Hello World!');
{% codeblock %}

expected end of comment, got end of file

Error ${#v0} ${#v1}

@tomByrer
Copy link

Thank you for looking into these.

@modkzs
Copy link

modkzs commented Mar 12, 2016

The error message that hexo s or g print is very bad. It doesn't mention which file, row and columns that cause generating failure. So every time I have to spend long time finding what error is

@leesei
Copy link
Member Author

leesei commented Apr 11, 2016

Stack trace color

Currently the stack track is logged in grey, which is hard to read

Done, see hexojs/hexo-log#1

@nickdesaulniers
Copy link

did this ever get merged? Seeing an unknown tag error, and while I can grep for the tag, a readable error message rather than a stack trace that listed the source file would be 💯

@leesei
Copy link
Member Author

leesei commented Jan 30, 2017

ping @tommy351, please merge the PR for hexo-log first.

@NoahDragon
Copy link
Member

Both changes are merged, thank you.
hexojs/hexo-log#1
hexojs/hexo-cli#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants