https://pulumi.com logo
#typescript
Title
# typescript
r

rough-tomato-98795

04/07/2020, 2:30 PM
Hello i am trying to write dynamic provider which will call external api and should cancel the deployment process creation when there is error in the response. Is it possible to do that.?
a

adorable-action-51248

04/07/2020, 2:34 PM
mmh. have you tried throwing an exception ?
r

rough-tomato-98795

04/07/2020, 2:35 PM
yes, it gives me: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process...
a

adorable-action-51248

04/07/2020, 2:38 PM
i think i am using the following set up in the
index.js
where i call my custom dynamic providers :
Copy code
module.exports = async function main() {
   const customResource = new CustomProvider(); 
}
i think this could prevent any leaking promises. but I am not sure.
r

rough-tomato-98795

04/07/2020, 2:43 PM
Well error happens when create function is called. So it is not in main thread anymore tho if i understand it correclty
a

adorable-action-51248

04/07/2020, 2:51 PM
mmh. do you have a minimal piece of code ?
r

rough-tomato-98795

04/07/2020, 3:12 PM
Ok nvm.. could't reproduce it in minimal example so i started to dig more into the problem. Lack of my nodejs knowladge is the real problem here. 🙂
😄 1
Thanks for your assist
🎉 1