Skip to content

Pass error on finish event on exit due to error#20

Open
bogusfocused wants to merge 1 commit intojculvey:masterfrom
bogusfocused:master
Open

Pass error on finish event on exit due to error#20
bogusfocused wants to merge 1 commit intojculvey:masterfrom
bogusfocused:master

Conversation

@bogusfocused
Copy link

To create a promise out of crawl method we require a finish event with error.

asyncCrawl() {
        return new Promise((resolve, reject) => {
            this.crawler.on('finish', function (err) { if(!err) resolve(); else reject(err) });
            this.crawler.crawl();
        })
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant