Completed
Push — master ( 628069...3da349 )
by Esaú
01:37
created

Exception.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 46
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 1
c 1
b 0
f 0
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 46
rs 10
bpm 1
cpm 1
noi 0
ccs 8
cts 8
cp 1
crap 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A ➔ Exception 0 3 1
1
// Exception.js
2
"use strict";
3
4
// :: DEPENDENCIES
5
6
// load native dependencies
7 1
const path = require("path");
8
9
// load local dependencies
10 1
const Throwable = require(path.join(__dirname, "Throwable.js"));
11
12
// :: BASIC SETUP
13
14
/**
15
 * Represents a {@linkcode Throwable} that an application might want to catch.
16
 * @param {String} name - The name of the <tt>Exception</tt>.
17
 * @param {String} message - The message describing the <tt>Exception</tt>.
18
 * @param {Number} code - The unique code that identifies the cause of the <tt>Exception</tt>.
19
 * @augments Throwable
20
 * @constructor
21
 * @see https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html
22
 */
23 1
const Exception = function (name, message, code) {
24 4121
    Throwable.call(this, name, message, code);
25
};
26
27
// :: INHERITANCE
28
29
// set the prototype chain parent to the Throwable 'class'
30 1
Exception.prototype = Object.create(Throwable.prototype);
31
32
// set the prototype chain constructor
33 1
Exception.prototype.constructor = Exception;
34
35
// :: PROTOTYPE
36
37
/**
38
 * The name used to identify an <tt>Exception</tt>.
39
 * @type {String}
40
 * @default
41
 */
42 1
Exception.prototype.name = "Exception";
43
44
// :: EXPORT
45
46
// export the Exception 'class'
47
module.exports = Exception;