From cad9032c4f5c7d75938073f58638e587379eb461 Mon Sep 17 00:00:00 2001 From: Giora Guttsait Date: Thu, 9 Jun 2022 17:15:06 +0300 Subject: [PATCH] fix(core): handle falsy error in params.ts#handleErrors (#10509) Co-authored-by: Craigory Coppola --- packages/nx/src/utils/params.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nx/src/utils/params.ts b/packages/nx/src/utils/params.ts index 0dfdbbd47ee05..931dc7c554433 100644 --- a/packages/nx/src/utils/params.ts +++ b/packages/nx/src/utils/params.ts @@ -72,6 +72,8 @@ export async function handleErrors(isVerbose: boolean, fn: Function) { try { return await fn(); } catch (err) { + err ??= new Error('Unknown error caught'); + if (err.constructor.name === 'UnsuccessfulWorkflowExecution') { logger.error('The generator workflow failed. See above.'); } else if (err.message) {