-
Notifications
You must be signed in to change notification settings - Fork 468
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
_acquire in case of reject return a promise, if this._acquire.promise is used in acquire, in case of reject an exception is raised that is not "captured" by the catch #1592
Conversation
I'm not sure I understand the problem. At worst it seems the Do you have a test or some code to reproduce the problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix your commit message. See https://www.conventionalcommits.org/en/v1.0.0/
It is a bit complex to explain, but I’ll try. All start from here : this is an uncaught exception from node-red [red] Uncaught Exception: If you can see all files in this stack trace is from this node (node-mssql), that is used by node-red-contrib-mssql-plus (a node-red node). Your question maybe is “Why this uncaught exception ? node-red-contrib-mssql-plus must do try catch to avoid this” See this piece of code shared.Promise.resolve(this._acquire().promise).catch(err => { If _acquire fail it return a reject (that is a promise itself), then you call promise method of a promise object (that does not exist) this fire an uncatchable exception (this.emit is not called for example), because if you use promise you can catch exception only with method catch, not with try … catch. Another point : it is more clear to return always one type from a method not one randomly selected that depends on what happens without managing each case. I my environment I had applied the patch with success, when a reject happen a catchable exception was throw (with this.emit inside catch). For the commit message, I don’t know how to change it, maybe I have to do another pull request ? I saw the web site that you indicated and I learned that I must start my commit message with fix : |
|
ac16c3d
to
55f5a9f
Compare
Thanks I modified commit message |
🎉 This PR is included in version 10.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What this does:
In case of reject acquire raise an exception that is controlled by catch : in previous version the raised exception was not captured from catch and if this node is used inside node-red-contrib-mssql-plus that run on node-red the result is an uncaught exception that stop it.
Related issues:
See this link bestlong/node-red-contrib-mssql-plus#88 (comment)
Pre/Post merge checklist: