Skip to content

Commit

Permalink
fix: Prevent logging cancel errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Nov 21, 2023
1 parent d90ba92 commit 24b50a6
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 24b50a6

Please sign in to comment.