Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 12 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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; |