# Catch ConnectionHandler errors (Connection is canceled)

**URL:** <https://community.sendbird.com/t/catch-connectionhandler-errors-connection-is-canceled/8225>\
**Category:** JavaScript\
**Tags:** chatsdk\
**Created:** [September 11, 2023, 5:19pm UTC](https://community.sendbird.com/t/catch-connectionhandler-errors-connection-is-canceled/8225 "2023-09-11T17:19:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Fritsch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/pedro_fritsch/32/4471_2.png) [@Pedro\_Fritsch](https://community.sendbird.com/u/Pedro_Fritsch)\
**Post date:** [September 11, 2023, 5:19pm UTC](https://community.sendbird.com/t/catch-connectionhandler-errors-connection-is-canceled/8225/1 "2023-09-11T17:19:53Z")

</div>

I have this simple code to add a connection handler; it’s working, but whenever it tries to reconnect and fails (onReconnectStarted → onReconnectFailed), it ends up throwing an error, and I can’t catch the error to handle it. What am I missing?

 ![d](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/b/b8139dd695cc5613ef05728423d74c1d9a6b5adc.jpeg)

This happens every time when the tab enter in a “standby” mode

---

<div class="post-metadata">

**Author:** ![uday.bhaskar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/uday.bhaskar/32/3966_2.png) [@uday.bhaskar](https://community.sendbird.com/u/uday.bhaskar)\
**Post date:** [September 12, 2023, 6:15am UTC](https://community.sendbird.com/t/catch-connectionhandler-errors-connection-is-canceled/8225/3 "2023-09-12T06:15:50Z")

</div>

Hello @Pedro_Fritsch,

Could you please share what does network tab shows when the reconnect is attempted?
