You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (server.listeners(name).length > 0) {
hasErrListeners = true;
errEvtNames.push(name);
}
if (server.listeners('restifyError').length > 0) {
hasErrListeners = true;
errEvtNames.push('restifyError');
}
if (hasErrListeners) {
// Sends all errEvtNames maybe in the same way as here:
// https://github.com/restify/node-restify/blob/5.x/lib/server.js#L939
} else {
res.send(err);
server._finishReqResCycle(req, res, null, err);
}
Are you willing and able to fix this?
"Yes"
The text was updated successfully, but these errors were encountered:
The Documentation isn't clear about that:
Here it says that only errors passed to next() cause restifyError to be emitted (Current misleading behaviour)
While here:
It says that catch errors of all types. (The expected behaviour)
Bug Report
restifyError
event is not emitted for errors generated internaly by Restify.(
NotFound
,MethodNotAllowed
,VersionNotAllowed
,UnsupportedMediaType
)Restify Version
restify@5.0.1
Node.js Version
node@8.1.4
Expected behaviour
restifyError must be called also for errors generated internally by Restify!
Actual behaviour
Hit ->
http://localhost:2300/notfound
Cause this:
Hit ->
http://localhost:2300/test
Cause this:
As per my opinion is really incoherent.
Repro case
Workaround
Cause
The problem is in
emitRouteError
https://github.com/restify/node-restify/blob/5.x/lib/server.js#L199
Possible solution
Are you willing and able to fix this?
"Yes"
The text was updated successfully, but these errors were encountered: