src/WrapperError.js
function WrapperError(message, innerError) {
  // supports instantiating the object without the new keyword
  if (!(this instanceof WrapperError)) {
    return new WrapperError(message, innerError);
  }

  Error.call(this);
  Error.captureStackTrace(this, WrapperError);

  this.message = message;
  this.innerError = innerError;
}
function WrapperError(message, innerError) {
  // supports instantiating the object without the new keyword
  if (!(this instanceof WrapperError)) {
    return new WrapperError(message, innerError);
  }

  Error.call(this);
  Error.captureStackTrace(this, WrapperError);

  this.message = message;
  this.innerError = innerError;
}
function WrapperError ( message , innerError ) { // supports instantiating the object without the new keyword if ( ! ( this instanceof WrapperError ) ) { return new WrapperError ( message , innerError ) ; } Error . call ( this ) ; Error . captureStackTrace ( this , WrapperError ) ; this . message = message ; this . innerError = innerError ; }
An Error object which wraps another Error instance.

@constructor
@extends Error
@param {String} message - Error message.
@param {Error} innerError - The Error instance to wrap.
An Error object which wraps another Error instance .