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 error message when validation.payload is set but type is GET #2347

Closed
wraithan opened this issue Jan 11, 2015 · 2 comments
Closed

Improve error message when validation.payload is set but type is GET #2347

wraithan opened this issue Jan 11, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@wraithan
Copy link

@wraithan wraithan commented Jan 11, 2015

Currently you get an error looking like:

/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/route.js:126
Hoek.assert(!this.settings.validate.payload || this.settings.payload.parse, 'R
                                                                    ^
TypeError: Cannot read property 'parse' of null
    at new module.exports.internals.Route (/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/route.js:126:73)
    at internals.Connection._addRoute (/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/connection.js:344:17)
    at internals.Connection._route (/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/connection.js:336:18)
    at internals.Plugin._apply (/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/plugin.js:432:14)
    at internals.Plugin.route (/Users/wraithan/devel/javascript/alert-alpaca/node_modules/hapi/lib/plugin.js:407:10)
    at Object.<anonymous> (/Users/wraithan/devel/javascript/alert-alpaca/index.js:7:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

It looks like there used to be a nicer error that was removed in a refactor:

4299e9e#diff-f34e409694d3ba334dabbea190f64c1dL117

@gergoerdosi
Copy link
Contributor

@gergoerdosi gergoerdosi commented Jan 11, 2015

See this PR: #2343

@wraithan
Copy link
Author

@wraithan wraithan commented Jan 11, 2015

@gergoerdosi Oh thanks! I didn't see an issue but I didn't look at the PRs. Not sure if you'll would rather keep the issue until the PR is closed or just close this out, either way is fine with me.

@hueniverse hueniverse added the bug label Jan 12, 2015
@hueniverse hueniverse self-assigned this Jan 12, 2015
@hueniverse hueniverse added this to the 8.2.0 milestone Feb 8, 2015
@hueniverse hueniverse closed this in 2fd9eef Feb 8, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants