Closed
Description
When attempting to run a function, which crashed on startup (for an unrelated reason), I got the following error:
[2023-12-12T12:41:34.171Z] Worker failed to load function: 'func-name' with functionId: '…'.
[2023-12-12T12:41:34.171Z] Result: Failure
[2023-12-12T12:41:34.171Z] Exception: Cannot set property message of [object Object] which has only a getter
[2023-12-12T12:41:34.171Z] Stack: TypeError: Cannot set property message of [object Object] which has only a getter
[2023-12-12T12:41:34.171Z] at h.<anonymous> (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/node/dist/src/worker-bundle.js:2:33509)
[2023-12-12T12:41:34.171Z] at Generator.throw (<anonymous>)
[2023-12-12T12:41:34.171Z] at a (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/node/dist/src/worker-bundle.js:2:32342).
instead of the actual error message that got thrown by my function.
worker-bundle.js:2:33509
corresponds to this line:
t.message=`Worker was unable to load function ${r.name}: '${t.message}'`
so there's something wrong with the way errors are handled.