Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

levelup constructor without callback causes unhandled rejection #656

@bjacokes

Description

@bjacokes

Using v4.0.1 of levelup and leveldown. The following command causes an unhandled rejection:

levelup(leveldown('/path/to/nonexistent/file'))

UnhandledPromiseRejectionWarning: OpenError: IO error: /path/to/nonexistent/file: No such file or directory
....
    at (node:69500) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

This happens because the final line in the LevelUP constructor, this.open(callback), is a floating promise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    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