# Dynatrace isn't capturing the javascript errors in my application which are handled by react-router error boundry.

**URL:** <https://community.dynatrace.com/t/dynatrace-isnt-capturing-the-javascript-errors-in-my-application-which-are-handled-by-react-router-error-boundry/49862>\
**Category:** Open Q&A\
**Tags:** errors, javascript\
**Created:** [January 22, 2025, 11:39am UTC](https://community.dynatrace.com/t/dynatrace-isnt-capturing-the-javascript-errors-in-my-application-which-are-handled-by-react-router-error-boundry/49862 "2025-01-22T11:39:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sai35277](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sai35277](https://community.dynatrace.com/u/sai35277)\
**Post date:** [January 22, 2025, 11:39am UTC](https://community.dynatrace.com/t/dynatrace-isnt-capturing-the-javascript-errors-in-my-application-which-are-handled-by-react-router-error-boundry/49862/1 "2025-01-22T11:39:14Z")

</div>

I have a reactjs application where i am using react-router library but that router library has a javascript error boundry error handling in built. So i am unabel to see that JS error in dynatrace. What can i do ?

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [February 3, 2025, 11:40am UTC](https://community.dynatrace.com/t/dynatrace-isnt-capturing-the-javascript-errors-in-my-application-which-are-handled-by-react-router-error-boundry/49862/2 "2025-02-03T11:40:02Z")

</div>

Using the injected Dynatrace javascript directly, you could add the errors to Dynatrace as well, by adding a few lines to your frontend central errorhandler…

please check more options in the documentation…

something like this (created a centralised error handler with window.error):

```auto
window.onerror = (event) => {
  console.log("Error occurred: " + event);
  //check if Dynatrace agent is available
  if (typeof dT_ !== 'undefined') {
    dtrum.reportError(event);
  }
}

```
