bugsnag / bugsnag-react-native

Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
https://docs.bugsnag.com/platforms/react-native
MIT License
369 stars 121 forks source link

Ability to set `errorClass` in new version? #482

Closed cristianoccazinsp closed 4 years ago

cristianoccazinsp commented 4 years ago

We previously used custom error classes (with both errorClass and groupingHash on the notify/error callbacks) to nicely organize/label a few logs. Now all errors seem to be labelled as "Error" and we are unable to customize its class.

Couldn't find anywhere in the documentation how to migrate this "breaking change".

Any help would be appreciated.

cristianoccazinsp commented 4 years ago

Figured it out afterwards... For anyone wondering the same:

if(event.errors && event.errors.length){event.errors[0].errorClass = "Your Custom Class";}
xljones commented 4 years ago

Hey @cristianoccazinsp, thanks for letting us know you've found a solution for this. For future travellers too, the documentation on this can be found here: https://docs.bugsnag.com/platforms/javascript/customizing-error-reports/#errors