Skip to main content
Answered

[Improvement] Allow the Intercom JS API to bubble exceptions up to the caller

  • January 27, 2022
  • 1 reply
  • 83 views

I have a small piece of JS that attaches itself to anchor elements that link to an Intercom Article. When these anchors are clicked I intercept the event and call the `Intercom( 'showArticle', articleId )` API method. This works as expected.

 

However, in local testing with a test environment those Article ID's are obviously not present. As expected, this fails and throws some errors in the console.

 

This got me thinking about providing graceful fallback. Would it be possible to bubble these exceptions up to the caller so that I could catch and handle appropriately? In this case I would open the anchors link as if nothing happened.

 

The goal here is to know about a failure with Intercom and have the opportunity to provide a graceful alternative for the user. This could mean that developers will need to handle exceptions bubbling from the API calls, a potentially disruptive change. Or, some kind of callback argument that can receive an error.

Best answer by Lisa B11

Hey @alex e11​ 👋

 

Thanks so much for this idea, this would be a great shout for @Product Wishlist​ 🙌

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+5
  • Employee
  • 250 replies
  • Answer
  • February 1, 2022

Hey @alex e11​ 👋

 

Thanks so much for this idea, this would be a great shout for @Product Wishlist​ 🙌


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings