src/vs/base/common/errorMessage.ts/createErrorWithActions
export function createErrorWithActions(messageOrError: string | Error, actions: IAction[]): IErrorWithActions {
	let error: IErrorWithActions;
	if (typeof messageOrError === 'string') {
		error = new Error(messageOrError) as IErrorWithActions;
	} else {
		error = messageOrError as IErrorWithActions;
	}

	error.actions = actions;

	return error;
}