function createClass( ctor ) {
	if ( !ctor ) {
		ctor = Error;
	}
	/**
	* Create a new object, which prototypically inherits from the Error constructor.
	*
	* @private
	* @constructor
	* @param {string} msg - error message
	* @returns {CustomError} custom error instance
	*/
	function CustomError( msg ) {
		this.name = 'CustomError';
		if ( msg ) {
			this.message = msg;
		}
		this.stack = ( new ctor() ).stack;
		return this;
	}

	/**
	* Create a prototype which inherits from the parent prototype.
	*/
	CustomError.prototype = Object.create( ctor.prototype );

	/**
	* Set the constructor.
	*/
	CustomError.prototype.constructor = CustomError;

	return CustomError;
}
Creates a CustomError class.

@private
@param {(Error|SyntaxError|ReferenceError|EvalError|RangeError|TypeError|URIError)} ctor - error constructor
@returns {CustomError} constructor