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

Add information about failing route when starting server #4107

Closed
Ginden opened this issue Jun 17, 2020 · 2 comments
Closed

Add information about failing route when starting server #4107

Ginden opened this issue Jun 17, 2020 · 2 comments
Labels
feature New functionality or improvement

Comments

@Ginden
Copy link

Ginden commented Jun 17, 2020

Support plan

  • which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: 10.15.3
  • module version: 18.4.1
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone?
  • any other relevant information:

What problem are you trying to solve?

I have bug in definition of route. I don't know where it is and what it is. Currently, Hapi gives you error without any details. Eg. I got error Invalid schema content: (externalCustomerId.$_root.alternatives).

I was able to pinpoint issue with monkey-hacking _setupValidation in route.js file.

Do you have a new or modified API suggestion to solve the problem?

I would like for Hapi to append information about route that failed validation as route property on error object.

@Ginden Ginden added the feature New functionality or improvement label Jun 17, 2020
@cjihrig
Copy link
Contributor

cjihrig commented Sep 4, 2020

hapi already does this to some extent. For example:

Error: Invalid route options (GET ) {
  "method": "GET",
  "pat": "/",
  "handler": (request, h) => {\n      return 'Hello World!';\n    },
  "path" [1]: -- missing --
}

[1] "path" is required

Please provide your route config.

@kanongil
Copy link
Contributor

This is already done, so we need details about the specific issue to resolve it. Closing it for now.

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

No branches or pull requests

3 participants