Skip to content

Commit 44c4af7

Browse files
authored
Apply suggestions from code review
1 parent a3d948b commit 44c4af7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class SentryOnDemandReplay: NSObject, SentryReplayVideoMaker {
139139

140140
func createVideoAsyncWith(beginning: Date, end: Date, completion: @escaping ([SentryVideoInfo]?, Error?) -> Void) {
141141
// Note: In Swift it is best practice to use `Result<Value, Error>` instead of `(Value?, Error?)`
142-
// Due to interoperability with Objective-C and @objc, we can not use Result here.
142+
// Due to interoperability with Objective-C and @objc, we can not use Result for the completion callback.
143143
SentryLog.debug("[Session Replay] Creating video with beginning: \(beginning), end: \(end)")
144144

145145
// Dispatch the video creation to a background queue to avoid blocking the calling queue.
@@ -203,7 +203,7 @@ class SentryOnDemandReplay: NSObject, SentryReplayVideoMaker {
203203
private func renderVideo(with videoFrames: [SentryReplayFrame], from: Int, at outputFileURL: URL, completion: @escaping (Result<SentryRenderVideoResult, Error>) -> Void) {
204204
SentryLog.debug("[Session Replay] Rendering video with \(videoFrames.count) frames, from index: \(from), to output url: \(outputFileURL)")
205205
guard from < videoFrames.count, let image = UIImage(contentsOfFile: videoFrames[from].imagePath) else {
206-
SentryLog.debug("[Session Replay] Failed to render video, reason: index out of bounds or can't read image at path: \(videoFrames[from].imagePath)")
206+
SentryLog.error("[Session Replay] Failed to render video, reason: index out of bounds or can't read image at path: \(videoFrames[from].imagePath)")
207207
return completion(.success(SentryRenderVideoResult(
208208
info: nil,
209209
finalFrameIndex: from
@@ -218,7 +218,7 @@ class SentryOnDemandReplay: NSObject, SentryReplayVideoMaker {
218218
do {
219219
videoWriter = try AVAssetWriter(url: outputFileURL, fileType: .mp4)
220220
} catch {
221-
SentryLog.debug("[Session Replay] Failed to create video writer, reason: \(error)")
221+
SentryLog.error("[Session Replay] Failed to create video writer, reason: \(error)")
222222
return completion(.failure(error))
223223
}
224224

0 commit comments

Comments
 (0)