for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
// Error.js
"use strict";
// :: DEPENDENCIES
// load native dependencies
const path = require("path");
// load local dependencies
const Throwable = require(path.join(__dirname, "Throwable.js"));
// :: BASIC SETUP
/**
* The class <tt>Error</tt> and its subclasses are a form of <tt>Throwable</tt> that indicates conditions that a
* reasonable application might want to catch.
* @param {String} name - The name of the <tt>Error</tt>.
* @param {String} message - The message describing the <tt>Error</tt>.
* @param {Number} code - The unique code that identifies the cause of the <tt>Error</tt>.
* @augments Throwable
* @constructor
* @see https://docs.oracle.com/javase/8/docs/api/java/lang/Error.html
*/
const Error2 = function (name, message, code) {
Throwable.call(this, name, message, code);
};
// :: INHERITANCE
// set the prototype chain parent to the Throwable 'class'
Error2.prototype = Object.create(Throwable.prototype);
// set the prototype chain constructor
Error2.prototype.constructor = Error2;
// :: PROTOTYPE
* The name used to identify an <tt>Error</tt>.
* @type {String}
* @default
Error2.prototype.name = "Error";
// :: EXPORT
// export the Error 'class'
module.exports = Error2;