lib/errors/http-error.js
function HTTPError(statusCode, data) {
  Error.call(this);
  Error.captureStackTrace(this, this.constructor);

  /**
   * Human-readable error name.
   *
   * @type {String}
   */
  this.name = http.STATUS_CODES[statusCode];

  /**
   * HTTP status code.
   *
   * @type {Number}
   */
  this.statusCode = statusCode;

  /**
   * Any additional data.
   *
   * @type {*}
   */
  this.data = data;

  if (data) {
    // Property of Error.
    this.message = JSON.stringify(data);
  }
}
function HTTPError(statusCode, data) {
  Error.call(this);
  Error.captureStackTrace(this, this.constructor);

  /**
   * Human-readable error name.
   *
   * @type {String}
   */
  this.name = http.STATUS_CODES[statusCode];

  /**
   * HTTP status code.
   *
   * @type {Number}
   */
  this.statusCode = statusCode;

  /**
   * Any additional data.
   *
   * @type {*}
   */
  this.data = data;

  if (data) {
    // Property of Error.
    this.message = JSON.stringify(data);
  }
}
function HTTPError ( statusCode , data ) { Error . call ( this ) ; Error . captureStackTrace ( this , this . constructor ) ; /**
   * Human-readable error name.
   *
   * @type {String}
   */ this . name = http . STATUS_CODES [ statusCode ] ; /**
   * HTTP status code.
   *
   * @type {Number}
   */ this . statusCode = statusCode ; /**
   * Any additional data.
   *
   * @type {*}
   */ this . data = data ; if ( data ) { // Property of Error. this . message = JSON . stringify ( data ) ; } }
Base class for errors.

@param {Number} statusCode
HTTP status code.

@param {*=} data
Any additional data.

@extends Error
@constructor
Base class for errors .