auth/errors/docusignapierror.js

/**
 * `DocusignAPIError` error.
 *
 * References:
 *   - https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#OAuth2/OAuth2 Response Codes.htm
 *
 * @constructor
 * @param {string} [message]
 * @param {string} [type]
 * @param {number} [code]
 * @param {number} [subcode]
 * @param {string} [traceID]
 * @access public
 */
function DocusignAPIError(message, type, code, subcode, traceID) {
    Error.call(this);
    Error.captureStackTrace(this, arguments.callee);
    this.name = 'DocusignAPIError';
    this.message = message;
    this.type = type;
    this.code = code;
    this.subcode = subcode;
    this.traceID = traceID;
    this.status = 500;
  }
  
  // Inherit from `Error`.
  DocusignAPIError.prototype.__proto__ = Error.prototype;
  
  
  // Expose constructor.
  module.exports = DocusignAPIError;