Skip to content

Friendly handling of connection failure #43

Open
@RobertLowe

Description

@RobertLowe

There's no handling for failure of the MongoClient, I purpose we add some.

Ex, if the mongo instance is down, the following is thrown:

[ERROR] TypeError: Cannot read property 'createCollection' of null
    at ./node_modules/db-migrate-mongodb/index.js:363:15
    at connectCallback (./node_modules/db-migrate-mongodb/node_modules/mongodb/lib/mongo_client.js:527:5)
    at ./node_modules/db-migrate-mongodb/node_modules/mongodb/lib/mongo_client.js:418:11
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

The other drivers do this:

https://github.com/db-migrate/mysql/blob/master/index.js#L508-L514

Cheers

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