Closed cristianoccazinsp closed 5 years ago
While calling notify, it seems like it is not possible to use custom error classes (that inherit from Error).
I've defined the following error classes:
export class Warning extends Error{ name = "Warning"; displayName = "Warning"; } Warning.constructor.name = "Warning"; export class Info extends Error{ name = "Info"; displayName = "Info"; }; Info.constructor.name = "Info";
However, when calling bugsnag.notify(new Info("some info")), it will always end up in the bugsnag console as "I [Native code]: 0".
bugsnag.notify(new Info("some info"))
My first guess is that the name gets mangled after minification, but I was hoping that setting constructor.name would fix it since that's what is used by the Report constructor here (https://github.com/bugsnag/bugsnag-react-native/blob/master/src/Bugsnag.js#L385)
Any ideas how can I send custom error names?
Library versions: "bugsnag-react-native": "2.23.1"
Ended up just setting the errorClass property on the report object. Looks like a babel issue just uglifying everything.
Description
While calling notify, it seems like it is not possible to use custom error classes (that inherit from Error).
Issue
I've defined the following error classes:
However, when calling
bugsnag.notify(new Info("some info"))
, it will always end up in the bugsnag console as "I [Native code]: 0".My first guess is that the name gets mangled after minification, but I was hoping that setting constructor.name would fix it since that's what is used by the Report constructor here (https://github.com/bugsnag/bugsnag-react-native/blob/master/src/Bugsnag.js#L385)
Any ideas how can I send custom error names?
Environment
Library versions: "bugsnag-react-native": "2.23.1"