Track all errors in Sentry

This commit is contained in:
Andy Uhnak
2022-08-22 10:20:36 +01:00
parent 30cb697304
commit a9d1e84252
44 changed files with 128 additions and 74 deletions
@@ -107,7 +107,7 @@ class VoiceMessageAttachmentCacheManager {
try setupTemporaryFilesFolder()
} catch {
completion(Result.failure(VoiceMessageAttachmentCacheManagerError.preparationError(error)))
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed creating temporary files folder with error: \(error)")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed creating temporary files folder", context: error)
return
}
@@ -140,7 +140,7 @@ class VoiceMessageAttachmentCacheManager {
do {
try FileManager.default.removeItem(at: temporaryFilesFolderURL)
} catch {
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed clearing cached disk files with error: \(error)")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed clearing cached disk files", context: error)
}
}
@@ -176,7 +176,7 @@ class VoiceMessageAttachmentCacheManager {
}, failure: { error in
// A nil error in this case is a cancellation on the MXMediaLoader
if let error = error {
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed decrypting attachment with error: \(String(describing: error))")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed decrypting attachment", context: error)
self.invokeFailureCallbacksForIdentifier(identifier, requiredNumberOfSamples: numberOfSamples, error: VoiceMessageAttachmentCacheManagerError.decryptionError(error))
}
semaphore.signal()
@@ -189,7 +189,7 @@ class VoiceMessageAttachmentCacheManager {
}, failure: { error in
// A nil error in this case is a cancellation on the MXMediaLoader
if let error = error {
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed preparing attachment with error: \(String(describing: error))")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed preparing attachment", context: error)
self.invokeFailureCallbacksForIdentifier(identifier, requiredNumberOfSamples: numberOfSamples, error: VoiceMessageAttachmentCacheManagerError.preparationError(error))
}
semaphore.signal()
@@ -232,14 +232,14 @@ class VoiceMessageAttachmentCacheManager {
semaphore.signal()
}
case .failure(let error):
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed retrieving audio duration with error: \(error)")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed retrieving audio duration", context: error)
self.invokeFailureCallbacksForIdentifier(identifier, requiredNumberOfSamples: numberOfSamples, error: VoiceMessageAttachmentCacheManagerError.durationError(error))
semaphore.signal()
}
}
}
case .failure(let error):
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed converting voice message with error: \(error)")
MXLog.error("[VoiceMessageAttachmentCacheManager] Failed converting voice message", context: error)
self.invokeFailureCallbacksForIdentifier(identifier, requiredNumberOfSamples: numberOfSamples, error: VoiceMessageAttachmentCacheManagerError.conversionError(error))
semaphore.signal()
}