Test Failed
Push — master ( 0888ee...91d545 )
by Dmytro
02:36
created

src/errors/ValidationError.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 14
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
mnd 0
bc 0
fnc 3
dl 0
loc 14
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

2 Functions

Rating   Name   Duplication   Size   Complexity  
A ValidationError.constructor 0 5 1
A ValidationError.toJSON 0 6 2
1
export default class ValidationError extends Error {
2
    constructor(cottus, errors) {
3
        super();
4
        this.cottus = cottus;
5
        this.errors = errors;
6
    }
7
8
    toJSON() {
9
        return {
10
            code    : 'VALIDATION_ERROR',
11
            details : this.errors.map(e => e.hash)
12
        };
13
    }
14
}
15