Skip to content

UnhandledPromiseRejectionWarning in result.js #257

Closed
@Steffen93

Description

@Steffen93

Hi,
I'm using the npm package of this neo4j driver in my nodejs application (Node version 7.4.0) and I'm getting the following warning all the time:

(node:11241) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'call' of undefined

The warning still appears in the current git version, I just cloned the repo and tested it.
It seems like in result.js in the lines 119 and 132, there is no 'catch' for the promises called there and that's why the warning is spit out by node (if your node version is 6.6.0+).

Changing

    self._connectionHolder.releaseConnection().then(() => {
        onCompletedOriginal.call(observer, sum);
    });

to

    self._connectionHolder.releaseConnection().then(() => {
        onCompletedOriginal.call(observer, sum);
    }).catch(() => {} );

removes the warning for me (tested locally), but I don't know if there is further error handling to do in the catch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions