From f1e66efcbe68670016fe840fc91b9a82351bd7b1 Mon Sep 17 00:00:00 2001 From: hossam-nasr Date: Tue, 9 May 2023 12:15:54 -0700 Subject: [PATCH] specify filename in loading entry point error --- src/startApp.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/startApp.ts b/src/startApp.ts index 9b0320b2..d891bdb6 100644 --- a/src/startApp.ts +++ b/src/startApp.ts @@ -43,6 +43,7 @@ export async function startApp(functionAppDirectory: string, channel: WorkerChan async function loadEntryPointFile(functionAppDirectory: string, channel: WorkerChannel): Promise { const entryPointPattern = channel.packageJson.main; if (entryPointPattern) { + let currentFile: string | undefined = undefined; try { const files = await globby(entryPointPattern, { cwd: functionAppDirectory }); if (files.length === 0) { @@ -50,6 +51,7 @@ async function loadEntryPointFile(functionAppDirectory: string, channel: WorkerC } for (const file of files) { + currentFile = file; channel.log({ message: `Loading entry point file "${file}"`, level: LogLevel.Debug, @@ -71,7 +73,9 @@ async function loadEntryPointFile(functionAppDirectory: string, channel: WorkerC } catch (err) { const error = ensureErrorType(err); channel.log({ - message: `Worker was unable to load entry point "${entryPointPattern}": ${error.message}`, + message: `Worker was unable to load entry point "${currentFile ? currentFile : entryPointPattern}": ${ + error.message + }`, level: LogLevel.Warning, logCategory: LogCategory.System, });