UNPKG

xts-binary-marketdata-api

Version:

The official JS client library for the Symphony Fintech Binary MarketData API's

27 lines (24 loc) 760 B
function CustomError(statusCode, message, fileName, lineNumber) { var instance = new Error(message, fileName, lineNumber); instance.name = 'CustomError'; instance.error = {"statusCode":statusCode,"message": message}; Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); if (Error.captureStackTrace) { Error.captureStackTrace(instance, CustomError); } return instance; } CustomError.prototype = Object.create(Error.prototype, { constructor: { value: Error, enumerable: false, writable: true, configurable: true } }); if (Object.setPrototypeOf){ Object.setPrototypeOf(CustomError, Error); } else { CustomError.__proto__ = Error; } module.exports=CustomError;