src/HTTPError.js
function HTTPError() {
	var args = Array.prototype.slice.call(arguments);
	if(!(this instanceof HTTPError)) {
		var self = new HTTPError();
		return FUNCTION(self).apply(self, args);
	}

	var headers, msg, code;
	ARRAY(args).forEach(function HTTPError_foreach(arg) {
		if(typeof arg === 'object') {
			headers = arg;
		}
		if(typeof arg === 'string') {
			msg = arg;
		}
		if(typeof arg === 'number') {
			code = arg;
		}
	});

	code = code || 500;
	msg = msg || (''+code+' '+require('http').STATUS_CODES[code]);
	headers = headers || {};

	Error.call(this);
	Error.captureStackTrace(this, this);
	this.code = code;
	this.message = msg;
	this.headers = headers;
}
function HTTPError() {
	var args = Array.prototype.slice.call(arguments);
	if(!(this instanceof HTTPError)) {
		var self = new HTTPError();
		return FUNCTION(self).apply(self, args);
	}

	var headers, msg, code;
	ARRAY(args).forEach(function HTTPError_foreach(arg) {
		if(typeof arg === 'object') {
			headers = arg;
		}
		if(typeof arg === 'string') {
			msg = arg;
		}
		if(typeof arg === 'number') {
			code = arg;
		}
	});

	code = code || 500;
	msg = msg || (''+code+' '+require('http').STATUS_CODES[code]);
	headers = headers || {};

	Error.call(this);
	Error.captureStackTrace(this, this);
	this.code = code;
	this.message = msg;
	this.headers = headers;
}
Exception type for HTTP errors