Skip to content

App crash due to unhandled promise rejection in Gus.getWorkItemIdByName #161

@mpsenn

Description

@mpsenn

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.<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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions