Socket
Socket
Sign inDemoInstall

ebay-api

Package Overview
Dependencies
55
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.0 to 1.9.0

test/errors.test.js

46

lib/errors.js

@@ -7,30 +7,38 @@ /**

var inherits = require('util').inherits;
var
inherits = require('util').inherits,
_ = require('lodash');
exports.EbayClientError = function EbayClientError(message) {
function EbayClientError(message, extraProps) {
Error.apply(this, arguments);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
};
inherits(exports.EbayClientError, Error);
_.extend(this, {message: message}, extraProps);
}
inherits(EbayClientError, Error);
exports.EbaySystemError = function EbaySystemError(message) {
Error.captureStackTrace(this, this.constructor);
function EbaySystemError(message, extraProps) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
this.message = message;
};
inherits(exports.EbaySystemError, Error);
}
inherits(EbaySystemError, EbayClientError);
exports.EbayRequestError = function EbayRequestError(message) {
Error.captureStackTrace(this, this.constructor);
function EbayRequestError(message) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
this.message = message;
};
inherits(exports.EbayRequestError, Error);
}
inherits(EbayRequestError, EbayClientError);
exports.EbayAuthenticationError = function EbayAuthenticationError(message) {
Error.captureStackTrace(this, this.constructor);
function EbayAuthenticationError(message) {
EbayClientError.apply(this, arguments);
this.name = this.constructor.name;
this.message = message;
}
inherits(EbayAuthenticationError, EbayClientError);
module.exports = {
EbayClientError: EbayClientError,
EbaySystemError: EbaySystemError,
EbayRequestError: EbayRequestError,
EbayAuthenticationError: EbayAuthenticationError,
};
inherits(exports.EbayAuthenticationError, Error);

@@ -260,2 +260,3 @@ /**

errors, // error object(s) in response.
extraErrorProps,
error = null; // final Error instance

@@ -313,18 +314,18 @@

// more context for programatically interpreting the error
extraErrorProps = {
severityCode: errorSeverityCode,
classification: errorClassification,
errors: errors,
details: _.clone(ack),
requestContext: _.clone(requestContext)
};
// still pass back the data! so client can ignore the warning/error if it chooses.
if (errorClassification === 'SystemError') {
error = new EbaySystemError("eBay API system " + errorSeverityCode.toLowerCase() + ": " + errorMessage);
error = new EbaySystemError("eBay API system " + errorSeverityCode.toLowerCase() + ": " + errorMessage, extraErrorProps);
}
else {
error = new EbayRequestError("eBay API request " + errorSeverityCode.toLowerCase() + ": " + errorMessage);
error = new EbayRequestError("eBay API request " + errorSeverityCode.toLowerCase() + ": " + errorMessage, extraErrorProps);
}
// more context for programatically interpreting the error
if (error) {
error.severityCode = errorSeverityCode;
error.classification = errorClassification;
error.errors = errors;
error.details = _.clone(ack);
error.requestContext = _.clone(requestContext);
}
}

@@ -331,0 +332,0 @@

{
"name": "ebay-api",
"description": "eBay API Client",
"version": "1.8.0",
"version": "1.9.0",
"homepage": "https://github.com/benbuckman/nodejs-ebay-api",

@@ -6,0 +6,0 @@ "author": "Ben Buckman",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc