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

bad error reporting for improper headers #17

Open
dherman opened this issue Jul 20, 2012 · 1 comment
Open

bad error reporting for improper headers #17

dherman opened this issue Jul 20, 2012 · 1 comment

Comments

@dherman
Copy link
Contributor

dherman commented Jul 20, 2012

When an .md file has improperly indented headers it seems to crash the JS code and report an internal error. For example, running codex on a project with a file containing the following:


---
title: Home

---

Hello, world.

produces the error:

/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:179
  throw new Error(msg + ', ' + context(this.peek()[1].input))
        ^
Error: document not properly dedented, near "\n---"
    at Parser.expect (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:179:9)
    at Parser.parseDoc (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:266:8)
    at Parser.parse (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:232:19)
    at Object.eval (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:384:46)
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:33:26
    at Array.forEach (native)
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:16:13
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:79:29
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:79:29
    at Object.oncomplete (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:85:27)

Dave

@logicalparadox
Copy link
Owner

This is the default yaml module error. Will surround it with a try/catch so it can report which markdown file it is referring to.

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

No branches or pull requests

2 participants