forcedotcom / forcedotcom/git2gus
App crash due to unhandled promise rejection in Gus.getWorkItemIdByName
- Dominant language
- JavaScript
- Stars
- 28
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
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:
1. Fix the app crash.
2. Refactor this class to correctly use Promises.
3. 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. (/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. (/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)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.