From d4ddef3635e603c510a366027a2cd7325c6f1e11 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 4 Apr 2023 15:25:39 -0400 Subject: [PATCH] chore(core): error when a project graph plugin fails --- packages/nx/src/project-graph/build-project-graph.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/nx/src/project-graph/build-project-graph.ts b/packages/nx/src/project-graph/build-project-graph.ts index fc975f24cccfa7..4ffe267d80b1a9 100644 --- a/packages/nx/src/project-graph/build-project-graph.ts +++ b/packages/nx/src/project-graph/build-project-graph.ts @@ -24,7 +24,6 @@ import { } from '../config/project-graph'; import { readJsonFile } from '../utils/fileutils'; import { NxJsonConfiguration } from '../config/nx-json'; -import { logger } from '../utils/logger'; import { ProjectGraphBuilder } from './project-graph-builder'; import { ProjectConfiguration, @@ -235,15 +234,8 @@ async function updateProjectGraphWithPlugins( try { graph = await plugin.processProjectGraph(graph, context); } catch (e) { - const message = `Failed to process the project graph with "${plugin.name}". This will error in the future!`; - if (process.env.NX_VERBOSE_LOGGING === 'true') { - console.error(e); - logger.error(message); - return graph; - } else { - logger.warn(message); - logger.warn(`Run with NX_VERBOSE_LOGGING=true to see the error.`); - } + const message = `Failed to process the project graph with "${plugin.name}".`; + throw new Error(message + '\n' + e.stack); } } return graph;