Cloud-side JavaScript "Promise" handling update

2018-07-03 06:16:00
94091
0
Blog picture

We are making our VoxEngine Cloud-side JavaScript API more standard compliant! Starting August 2018 rejected promises without a "catch" clause will trigger a scenario stop with an "Unhandled promise rejection" message. This brings our JavaScript engine in line with modern web browsers, making it easier to write correct scenarios. Not handling an exception at the root level or not handling a rejected promise at the root level is now handled the same way by explicitly notifying developers about possible problems with their code flow logic.

Before August 2018 update rejected top-level promises are not handled by our JavaScript engine:

AI.detectVoicemail(call)
  .then(e => {/* This code is executed if voicemail is detected */});
// But what happens if voicemail is NOT detected? Nothing. And that is wrong

After August 2018 update, the code above will stop JavaScript scenarios in case of a rejected promise, so developers can see an error message. The following code allows to explicitly specify what to do if a promise is rejected:

AI.detectVoicemail(call)
  .then(e => {/* This code is executed if voicemail is detected */})
  .catch(e => {/* This code is executed if voicemail is NOT detected */});
Sign Up for a free Voximplant developer account or talk to our experts

Add your comment

Name*
Email*
Message

Your comment has been added and will be published after moderation.

Recommended posts

5 Tactics to Strengthen Your Contact Center Operations with Technology

5 Tactics to Strengthen Your Contact Center Operations with Technology

In our fast-paced, digitally focused world, customers want personalized service at lightning speed. A Hubspot survey of 1,000 customers found that 90% of people expect a response from a live customer service agent in ten minutes or less. Because expectations are so high, the pressure is on for customer service agents to consistently provide quick, high-quality customer experiences. Offering an elevated level of service with such a fast turnaround is next to impossible with manual support alone. And even if you have some digital tools in your tech stack, traditional contact center technology can fall short when it comes to efficiency. That’s why choosing no-fuss technology that automates your contact center’s routine operations is essential for making tasks more manageable for your agents.

Personalized Service 101: What it is and How to Deliver it

Personalized Service 101: What it is and How to Deliver it

For many consumers, personalized customer service is key to good customer experiences (CX). According to a 2020 survey by Gladly, close to two-thirds of respondents said that “lack of personalization makes [them] feel like a ticket number.” Businesses wishing to meet and exceed customer expectations need to make personalized service a top priority. But personalization goes beyond making movie recommendations or using a customer’s name in an email subject line. When it comes to personalized service, it’s paramount that you deliver relevant, valuable, and speedy support to promote positive customer experiences. In this article, we’ll break down what personalized service means, why it’s so important to CX, and how you can deliver personalization service to your customers.

Voximplant Kit vs Talkdesk: Comparing contact centers for the small and medium enterprise

Voximplant Kit vs Talkdesk: Comparing contact centers for the small and medium enterprise

Any contact center manager considering a new cloud communications solution needs to do their “due diligence” before choosing a provider, including those in small to medium enterprises. The stakes are high for SMEs because your needs are unique and there are significant differences in the available providers. Your decision not only affects your organization’s budget, but also its business processes, customer experiences, and agent work environment.