Skip to content

Commit 6dbdfa3

Browse files
Copilotmurki
andauthored
Simplify persistLastExitReasonIfNeeded to use single processAppExitReport call
Agent-Logs-Url: https://github.com/bitdriftlabs/capture-sdk/sessions/1eea7ae0-62e8-43c2-92b3-c17d8583429c Co-authored-by: murki <216735+murki@users.noreply.github.com>
1 parent db6248f commit 6dbdfa3

File tree

1 file changed

+3
-9
lines changed
  • platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports

1 file changed

+3
-9
lines changed

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/IssueReporter.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,14 @@ internal class IssueReporter(
166166
if (lastReasonResult is LatestAppExitReasonResult.Valid) {
167167
val lastReason = lastReasonResult.applicationExitInfo
168168
latestAppExitInfoProvider.convertExitReasonToFbsReportType(lastReason.reason)?.let { fatalIssueType ->
169-
val traceInputStream = lastReason.traceInputStream
170-
traceInputStream?.use {
169+
lastReason.traceInputStream.use { traceInputStream ->
171170
issueReporterProcessor?.processAppExitReport(
172171
fatalIssueType = fatalIssueType,
173172
timestamp = lastReason.timestamp,
174173
description = lastReason.description,
175-
traceInputStream = it,
174+
traceInputStream = traceInputStream,
176175
)
177-
} ?: issueReporterProcessor?.processAppExitReport(
178-
fatalIssueType = fatalIssueType,
179-
timestamp = lastReason.timestamp,
180-
description = lastReason.description,
181-
traceInputStream = null,
182-
)
176+
}
183177
}
184178
}
185179
}

0 commit comments

Comments
 (0)