This TypeError is unhandled, causes a promise to reject, and crashes the app. This function looks like it doesn't really understand Promises either, since it mixes callback functions and async/await.
Wishlist:
Fix the app crash.
Refactor this class to correctly use Promises.
Install a global unhandledpromiserejection logger? Not sure if we want these to lead to app crashes, or just error logs.
TypeError: Cannot read properties of undefined (reading 'Id')
at /app/api/services/Gus/getWorkItemIdByName.js:29:31
at promiseCallback (/app/node_modules/jsforce/lib/query.js:337:15)
at module.exports.<anonymous> (/app/node_modules/jsforce/lib/query.js:350:5)
at Object.onceWrapper (node:events:510:26)
at module.exports.emit (node:events:390:28)
at module.exports.<anonymous> (/app/node_modules/jsforce/lib/query.js:369:14)
at Object.onceWrapper (node:events:509:28)
at module.exports.emit (node:events:390:28)
at endReadableNT (/app/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
This TypeError is unhandled, causes a promise to reject, and crashes the app. This function looks like it doesn't really understand Promises either, since it mixes callback functions and async/await.
Wishlist: