Skip to content

Hapi: correctly extract url from request object #196

@AdriVanHoudt

Description

@AdriVanHoudt

If you are still having issues, please be sure to include as much information as
possible:

Environment details

  • OS: Mac/Linux
  • Node.js version: 8.11.4
  • npm version: 6.4.0
  • @google-cloud/error-reporting version: 0.5.1
  • hapi version: 16.x (<- probably the most important one :D)

Steps to reproduce

  1. Throw in request handler
  2. Error logged in cloud console is missing an url
    * image

This is due to

.setUrl(req!.url as {} as string)

req.url can be an URL object. I would suggest to fallback to req.path or req.url.path.
If that sounds ok I can do a PR if you'd like

Following these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: clouderrorreportingIssues related to the googleapis/nodejs-error-reporting API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions