All files / lib rest-base-error.js

69.6% Statements 71/102
60% Branches 3/5
17.64% Functions 3/17
69.6% Lines 71/102

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 1021x 1x 1x 1x 1x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x       8x 1x 1x 1x 1x     1x 1x 9x 9x 1x 1x     1x 1x     1x 1x 1x 1x 1x 1x     1x 1x 8x 8x 1x 1x     1x 1x     1x 1x 1x 1x 1x 1x     1x 1x     1x 1x     1x 1x     1x 1x 1x 1x 1x 1x     1x 1x     1x 1x     1x 1x     1x 1x 1x 1x 1x
'use strict';
 
class RestBaseError extends Error {
 
	constructor(message, verb, url, innerError = null) {
		super(message);
 
		this._name = this.constructor.name;
		this._code = null;
		this._verb = verb;
		this._url = url;
 
		// Build stack trace.
		Error.captureStackTrace(this, this.constructor);
		if (innerError && innerError.stack) {
			this.stack += '\n';
			this.stack += innerError.stack;
		}
	}
 
	//region "name" Accessors
 
	getName() {
		return this._name;
	}
 
	get name() {
		return this._name;
	}
 
	setName(value) {
		this._name = value;
	}
 
	set name(value) {
		this._name = value;
	}
 
	//endregion
 
	//region "code" Accessors
 
	getCode() {
		return this._code;
	}
 
	get code() {
		return this._code;
	}
 
	setCode(value) {
		this._code = value;
	}
 
	set code(value) {
		this._code = value;
	}
 
	//endregion
 
	//region "verb" Accessors
 
	getVerb() {
		return this._verb;
	}
 
	get verb() {
		return this._verb;
	}
 
	setVerb(value) {
		this._verb = value;
	}
 
	set verb(value) {
		this._verb = value;
	}
 
	//endregion
 
	//region "url" Accessors
 
	getUrl() {
		return this._url;
	}
 
	get url() {
		return this._url;
	}
 
	setUrl(value) {
		this._url = value;
	}
 
	set url(value) {
		this._url = value;
	}
 
	//endregion
}
 
exports.RestBaseError = RestBaseError;