Skip to main content

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.

Hey @alex e11​ 👋

 

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


Reply