Answered

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

  • 28 January 2022
  • 1 reply
  • 37 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.

icon

Best answer by Lisa B11 1 February 2022, 11:36

View original

1 reply

Hey @alex e11​ 👋

 

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

Reply