Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restify

Package Overview
Dependencies
Maintainers
2
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify - npm Package Compare versions

Comparing version 2.8.4 to 2.8.5

5

CHANGES.md

@@ -5,2 +5,7 @@ # restify Changelog

## 2.8.5
- Add ability to listen for error events
- Documentation fixes
## 2.8.4

@@ -7,0 +12,0 @@

27

lib/server.js

@@ -145,2 +145,4 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved.

}
req.log.trace({name: name, err: err}, 'entering emitRouteError');
if (server.listeners(name).length > 0) {

@@ -651,2 +653,6 @@ server.emit(name, req, res, once(function () {

var t;
var errName;
var emittedError = false;
if (cb)
cb = once(cb);

@@ -657,5 +663,14 @@ function next(arg) {

if (arg instanceof Error) {
log.trace({err: arg}, 'next(err=%s)',
errName = arg.name.replace(/Error$/, '');
log.trace({err: arg, errName: errName}, 'next(err=%s)',
(arg.name || 'Error'));
res.send(arg);
if (self.listeners(errName).length > 0) {
self.emit(errName, req, res, arg, once(function () {
res.send(arg);
return (cb ? cb(arg) : true);
}));
emittedError = true;
} else {
res.send(arg);
}
done = true;

@@ -752,3 +767,9 @@ } else if (typeof (arg) === 'string') {

return (cb ? cb(arg) : true);
// don't return cb here if we emit an error since we will cb after the
// handler fires.
if (!emittedError) {
return (cb ? cb(arg) : true);
} else {
return (true);
}
}

@@ -755,0 +776,0 @@

5

package.json

@@ -33,3 +33,4 @@ {

"Ben Doerr",
"Patrick Mooney"
"Patrick Mooney",
"Yunong Xiao"
],

@@ -39,3 +40,3 @@ "name": "restify",

"description": "REST framework",
"version": "2.8.4",
"version": "2.8.5",
"repository": {

@@ -42,0 +43,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc