Skip to content
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

Warning message output from hook.js #136

Closed
sonycamera opened this issue Dec 14, 2017 · 3 comments
Closed

Warning message output from hook.js #136

sonycamera opened this issue Dec 14, 2017 · 3 comments

Comments

@sonycamera
Copy link
Contributor

Version 2.9.0

I'm using transaction.start()/end() hooks in my project. I saw a warning message printed on console in debug:
(node:3889) Warning: .then() only accepts functions but was passed: [object Object]

It seems that there is a typo in function end()/rollback() in hook.js:

      return trx.commit()
        .then(() => debug('finished transaction %s with success', id))
        .then(hook);

When I removed .then(hook), the warning message disappeared.

@daffl
Copy link
Member

daffl commented Dec 14, 2017

That is definitely not right. Can you change it to

      return trx.commit()
        .then(() => debug('finished transaction %s with success', id))
        .then(() => hook);

And submit a PR?

@sonycamera
Copy link
Contributor Author

OK, PR created #137

@daffl
Copy link
Member

daffl commented Dec 14, 2017

Closed via #137

@daffl daffl closed this as completed Dec 14, 2017
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

No branches or pull requests

2 participants