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

restify

Package Overview
Dependencies
Maintainers
1
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 0.4.4 to 0.5.0

41

lib/error.js

@@ -6,2 +6,23 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.

///--- Error Base class
function RESTError(errorName, errorCode, msg, caller) {
if (Error.captureStackTrace)
Error.captureStackTrace(this, caller || RESTError);
this.__defineGetter__('code', function() {
return errorCode;
});
this.__defineGetter__('name', function() {
return errorName;
});
this.__defineGetter__('message', function() {
return msg || errorName;
});
}
util.inherits(RESTError, Error);
module.exports = {

@@ -51,1 +72,21 @@

};
Object.keys(RestCodes).forEach(function(code) {
var err = '' + code;
if (!/\w+Error$/.test(err))
err += 'Error';
// At this point LDAP_OPERATIONS_ERROR is now OperationsError in $err
// and 'Operations Error' in $msg
module.exports[err] = function(code, message, caller) {
RESTError.call(this,
err,
code,
(typeof(message) === 'string' ? message : ''),
caller || module.exports[err]);
}
module.exports[err].constructor = module.exports[err];
util.inherits(module.exports[err], RESTError);
});

9

lib/restify.js
// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
var errors = require('./error');
module.exports = {

@@ -23,4 +25,2 @@

newError: require('./error').newError,
RestCodes: require('./rest_codes'),

@@ -33,1 +33,6 @@

};
Object.keys(errors).forEach(function(k) {
module.exports[k] = errors[k];
});
{
"name": "restify",
"description": "REST framework specifically meant for web service APIs",
"version": "0.4.4",
"version": "0.5.0",
"repository": {

@@ -6,0 +6,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