raise(type, fmt, ...args) {
			let e = null;
			const msg = fmt ? String.prototype.format.call(fmt, ...args) : null;
			const stack = [];

			if (type instanceof Error) {
				e = type;

				if (msg)
					e.message = `${msg}: ${e.message}`;
			}
			else {
				try { throw new Error('stacktrace') }
				catch (e2) { stack.push(...(e2.stack ?? '').split(/\n/)) }

				e = new (window[type ?? 'Error'] ?? Error)(msg ?? 'Unspecified error');
				e.name = type ?? 'Error';
			}

			for (let i = 0; i < stack.length; i++) {
				const frame = stack[i].replace(/(.*?)@(.+):(\d+):(\d+)/g, 'at $1 ($2:$3:$4)').trim();
				stack[i] = frame ? `  ${frame}` : '';
			}

			if (!/^  at /.test(stack[0]))
				stack.shift();

			if (/\braise /.test(stack[0]))
				stack.shift();

			if (/\berror /.test(stack[0]))
				stack.shift();

			if (stack.length)
				e.message += `\n${stack.join('\n')}`;

			if (window.console && console.debug)
				console.debug(e);

			throw e;
		}
Captures the current stack trace and throws an error of the
specified type as a new exception. Also logs the exception as
error to the debug console if it is available.

@instance
@memberof LuCI

@param {Error|string} [type=Error]
Either a string specifying the type of the error to throw or an
existing `Error` instance to copy.

@param {string} [fmt=Unspecified error]
A format string which is used to form the error message, together
with all subsequent optional arguments.

@param {...*} [args]
Zero or more variable arguments to the supplied format string.

@throws {Error}
Throws the created error object with the captured stack trace
appended to the message and the type set to the given type
argument or copied from the given error instance.