Skip to content

Commit

Permalink
captureCrashReport method improved
Browse files Browse the repository at this point in the history
  • Loading branch information
RNEvok committed Jun 9, 2024
1 parent 2b4c803 commit 1f9d356
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,8 @@ class Connector {
const crashReportId = this._currentCrashReportId++;

let _stackTraceData;
if (((data instanceof Error) || data?.stack) && this._getStackTraceFn)
_stackTraceData = await this._getStackTraceFn(data.stack, this._stackTraceOptions);

if (((data instanceof Error) || data?.stack || (data?.error instanceof Error) || data?.error?.stack) && this._getStackTraceFn)
_stackTraceData = await this._getStackTraceFn(data.stack ?? data.error.stack, this._stackTraceOptions);
const encryptedData = this._encryptData({timestamp, crashReportId: `ACR_${crashReportId}`, type, data, _stackTraceData});
encryptedData.ok && this._socket?.emit(SOCKET_EVENTS_EMIT.CAPTURE_CRASH_REPORT, encryptedData.result);
}
Expand Down

0 comments on commit 1f9d356

Please sign in to comment.