Skip to content

Error handling with route #2883

@pwielgolaski

Description

@pwielgolaski

I would like to get information in my error handler what endpoint was handling it. The problem that I have is that when error handler is run req.baseUrl is not available

I wanted to use line like this

var endpoint = req.route ? (req.baseUrl + req.route.path) : '<no endpoint>';

but when route is mounted i.e at /users/ I can get only :id and empty baseUrl. I don't want to have information about individual request like /users/myname

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions