From 24b50a662f53536c36a706754b2d31d1df6752e4 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Tue, 21 Nov 2023 10:11:42 +0100 Subject: [PATCH] fix: Prevent logging cancel errors --- MailCore/Utils/SentryDebug.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MailCore/Utils/SentryDebug.swift b/MailCore/Utils/SentryDebug.swift index ac76fe369..29760bb09 100644 --- a/MailCore/Utils/SentryDebug.swift +++ b/MailCore/Utils/SentryDebug.swift @@ -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)