-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Rejection Error #9
Comments
Good catch @codinfox . It doesn't look like it's intentional to me (though I could be wrong). @deontologician is currently out of office, but he will look into it when he's back. |
Thanks, @danielmewes ! ...
r.table(dbConn.TABLE_NAME).indexWait(dbConn.INDEX_NAME).run(conn).then(function(){
conn.close();
successCallback();
}).error(function() {
console.log('Setting up database...');
// The database/table/index was not available, create them
r.dbCreate(dbConn.DATABASE_NAME).run(conn).finally(function() {
return r.tableCreate(dbConn.TABLE_NAME).run(conn);
}).finally(function() {
return r.table(dbConn.TABLE_NAME).indexCreate(dbConn.INDEX_NAME).run(conn);
}).catch(function(){})/*We swallow the results of the above promises*/.finally(function() {
return r.table(dbConn.TABLE_NAME).indexWait(dbConn.INDEX_NAME).run(conn);
}).then(successCallback).error(function(err) {
console.log('Could not wait for the completion of indexing.')
console.log(err.message);
process.exit(1);
}).finally(conn.close);
});
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue is about the demo of promise.
It seems that https:/rethinkdb/rethinkdb-example-nodejs/blob/master/todo-angular-express-promise/app.js#L135 and https:/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:Or, are these codes written this way on specific purposes?
The text was updated successfully, but these errors were encountered: