Skip to content

Unhandled Rejection Error #9

Open
@codinfox

Description

This issue is about the demo of promise.

It seems that https://github.com/rethinkdb/rethinkdb-example-nodejs/blob/master/todo-angular-express-promise/app.js#L135 and https://github.com/rethinkdb/rethinkdb-example-nodejs/blob/master/todo-angular-express-promise/app.js#L137 can be rejected and since they are not handled by any .error() clause, it is likely to throw an error. I think the right way to do is:

...
        }).finally(function() {
            return r.table('todos').indexCreate('createdAt').run(conn);
        }).finally(function(result) {
            return r.table('todos').indexWait('createdAt').run(conn)
        }).then(function(result) {
...

Or, are these codes written this way on specific purposes?

Metadata

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