Skip to main content
Answered

JS API error handling


The JS API has no documented methods for capturing and handling errors. Is there an undocumented callback that can be used to capture and gracefully handle errors? If not, why not? Both the Android and iOS SDKs have error handling but there is zero documented error handling for the JS API. This makes the API far less useful.

All assistance appreciated.

Best answer by Eden

Hey @Tom Tupper 👋 Eden from the support engineer team here.

 

We don't have specific documentation that outlines JS error handling, however this article here outlines some potential situations where errors may arise and how to troubleshoot them. 

 

We typically take a look at the browser console to see errors that come up when troubleshooting, however having error handing for the JS API is a great feature request! 

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

4 replies

Eden
Employee
Forum|alt.badge.img
  • Premier Customer Support Engineer
  • 121 replies
  • Answer
  • July 26, 2023

Hey @Tom Tupper 👋 Eden from the support engineer team here.

 

We don't have specific documentation that outlines JS error handling, however this article here outlines some potential situations where errors may arise and how to troubleshoot them. 

 

We typically take a look at the browser console to see errors that come up when troubleshooting, however having error handing for the JS API is a great feature request! 


I’m in a similar situation as @Tom Tupper


We want to gracefully handle errors thrown by the chat and currently there is no way to do this.
 

An example use case would be:
1. If the Intercom chat fails to load
2. Show a fallback message telling users to communicate via email


Currently, there is no way to know if the Intercom chat loaded correctly nor listen to chat errors.

Ideally, we’d be able to use something like:

window.Intercom(‘onError’, () => { // Do something when Intercom fails to load })


or at least check the status of Intercom

/**
 * Return true when calls to "https://api-iam.eu.intercom.io/messenger/web/home
 * are successful, or false if not
 */
window.Intercom(‘booted’)


We also have identity verification set up for this project, so there are a lot of moving pieces working together. It’s too optimistic to think that Intercom will never fail to load.


  • New Participant
  • 1 reply
  • December 6, 2023

i too would appreciate a callback or any other mechanism to guard against situations in which intercom failed to load entirely.

Intercom('show', function(err) { /** handle 403 or other error **/ });

Hello, having this error handling feature would be really appreciated ? are there any news on this subject ?

 

I came from an error where the showArticle method failed to open the article even when the article exists and is public.


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