Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Fixed

- Drop non-error objects reported as crashes since they don't have a stack trace ([#1279](https://github.com/Instabug/Instabug-React-Native/pull/1279)).
- Fix APM network logging on iOS when the response body is missing or empty. ([#1273](https://github.com/Instabug/Instabug-React-Native/pull/1273)).

## [13.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.2.0...v13.3.0) (August 4, 2024)
Expand Down
29 changes: 18 additions & 11 deletions src/modules/CrashReporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,25 @@ export const setEnabled = (isEnabled: boolean) => {
* @param nonFatalOptions extra config for the non-fatal error sent with Error Object
*/
export const reportError = (error: ExtendedError, nonFatalOptions: NonFatalOptions = {}) => {
let level = NonFatalErrorLevel.error;
if (nonFatalOptions.level != null) {
level = nonFatalOptions.level;
if (error instanceof Error) {
let level = NonFatalErrorLevel.error;
if (nonFatalOptions.level != null) {
level = nonFatalOptions.level;
}
return InstabugUtils.sendCrashReport(error, (data) =>
NativeCrashReporting.sendHandledJSCrash(
data,
nonFatalOptions.userAttributes,
nonFatalOptions.fingerprint,
level,
),
);
} else {
console.warn(
`IBG-RN: The error ${error} has been omitted because only error type is supported.`,
);
return;
}
return InstabugUtils.sendCrashReport(error, (data) =>
NativeCrashReporting.sendHandledJSCrash(
data,
nonFatalOptions.userAttributes,
nonFatalOptions.fingerprint,
level,
),
);
};

/**
Expand Down