const util = require('util');
const coerceError = require('./coerce-error');

function CuvvaError(code, reasons, meta) {
	if (!(this instanceof CuvvaError))
		return new CuvvaError(code, reasons, meta);

	if (!Array.isArray(reasons)) {
		meta = reasons;
		reasons = void 0;
	}

	if (reasons) {
		for (var i in reasons) {
			if (!(reasons[i] instanceof CuvvaError))
				reasons[i] = coerceError(reasons[i]);
		}
	}

	CuvvaError.super_(code);
	Error.captureStackTrace(this, this.constructor);

	Object.defineProperty(this, 'name', { get: function () { return 'CuvvaError'; } });
	Object.defineProperty(this, 'message', { get: function () { return this.code; } });

	this.code = code;
	this.httpStatus = CuvvaError.httpStatusMap[code] || 500;
	this.meta = meta;
	this.reasons = reasons;
}

CuvvaError.httpStatusMap = {};

util.inherits(CuvvaError, Error);
module.exports = CuvvaError;

@@ -275,25 +275,8 @@
 %09%7D%0A%0A
-%09if (reasons) %7B%0A%09
 %09for
@@ -297,17 +297,16 @@
 sons) %7B%0A
-%09
 %09%09if (!(
@@ -343,17 +343,16 @@
 or))%0A%09%09%09
-%09
 reasons%5B
@@ -385,12 +385,8 @@
 %5D);%0A
-%09%09%7D%0A
 %09%7D%0A%0A
@@ -462,16 +462,76 @@
 ctor);%0A%0A
+%09const statusCode = CuvvaError.httpStatusMap%5Bcode%5D %7C%7C 500;%0A%0A
 %09Object.
@@ -696,34 +696,38 @@
 %7D);%0A
-%0A%09this.code = code;%0A%09
+%09Object.defineProperty(
 this
-.
+, '
 http
@@ -736,48 +736,75 @@
 atus
- = CuvvaError.httpStatusMap%5Bcode%5D %7C%7C 500
+', %7B get: function () %7B return statusCode; %7D %7D);%0A%0A%09this.code = code
 ;%0A%09t

Make CuvvaError.httpStatus a getter