Completed
Push — master ( 2040ba...cef9c4 )
by Vitaly
02:22
created

error.js ➔ toString   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 3
rs 10
nop 0
1
function APIError(code, message) {
2
    this.code = code;
3
    this.message = (message || '');
4
}
5
6
Object.setPrototypeOf(APIError.prototype, Error.prototype);
7
APIError.prototype.name = 'APIError';
8
APIError.prototype.toString = function toString() {
9
    return this.code + ' - ' + this.message;
10
};
11
12
export default APIError;