-
Notifications
You must be signed in to change notification settings - Fork 11
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
Creating a portfolio with a duplicate name error is not catchable. #1116
Comments
Hi @po0uyan, thanks for bringing this to our attention. The SDK was designed on a previous version of node, where unhandled promises did not crash the process. This is something we will look into solving more correctly soon, but in the meantime you can use process.on('unhandledRejection', reason => {
console.warn(`unhandled rejection, reason: ${reason}`);
}); We will be looking into a solution where this isn't needed, but hopefully this works for you in the meantime. |
Great thanks. |
You can use const prepareTransactionsPromise = defusePromise(this.prepareTransactions(procArgs)); Should be safe since the promise is being handled later on anyway P.S.: Hi :D |
Thanks @monitz87 , is this available on Polymesh too? can you elaborate more on how I can implement this in creating a portfolio example? |
@po0uyan no, sorry for the misunderstanding. My comment was referring to how the bug can be fixed in the SDK code, not to how it can be sidestepped in userland |
use `defusePromise` to prevent process crashes from unhandled promise rejections ✅ Closes: #1116
@monitz87 Thanks, that seems to resolve the issue! Sorry for the late reply, I missed the notification you replied. We've been busy working on the zero knowledge "polymesh-private" stuff which is wrapping up. I figured I would finally have time to tackle this only to find you posted the fix like 6 weeks ago. I hope things are going well for you! |
🎉 This issue has been resolved in version 24.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@po0uyan You should be able to use the alpha release: It will get merged into beta and master at a later date. |
🎉 This issue has been resolved in version 24.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
use `defusePromise` to prevent process crashes from unhandled promise rejections ✅ Closes: #1116
🎉 This issue has been resolved in version 24.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 23.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi, let's consider the following is creating a portfolio which is already there.
What I expect from this block of code is that If it fails for any reason including a duplicate portfolio name, It would be catchable inside that catch block. But it fails with the following error and doesn't end up in catch block:
can you please guide me through the correct way of handling this?
The text was updated successfully, but these errors were encountered: