Skip to content

Commit

Permalink
Merge pull request #1133 from Infomaniak/less-logging
Browse files Browse the repository at this point in the history
fix: Prevent logging cancel errors
  • Loading branch information
valentinperignon authored Nov 22, 2023
2 parents 2c97dbf + 24b50a6 commit 35824de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MailCore/Utils/SentryDebug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ public enum SentryDebug {
breadcrumb.data = metadata
SentrySDK.addBreadcrumb(breadcrumb)

// Only capture non cancel error
guard error.asAFError?.isExplicitlyCancelledError != true && (error as? CancellationError) == nil else {
return
}

// Add an error
SentrySDK.capture(message: category) { scope in
scope.setExtras(metadata)
Expand Down

0 comments on commit 35824de

Please sign in to comment.