Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not track cancellation errors #1664

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Conversation

Anderas
Copy link
Contributor

@Anderas Anderas commented Dec 15, 2022

We log errors in a lot of places across the codebase via MXLog.error(... error) passing in any error that was returned from some api, incl rest clients that may return cancellation errors. These are not userful to track in analytics as they occur due to some user action. Instead of filtering them out in the many many places where we log errors, we will filter them out all at once in MXAnalyticsDestination

@Anderas Anderas requested review from a team and pixlwave and removed request for a team December 15, 2022 11:46
@@ -30,12 +30,20 @@ class MXAnalyticsDestination: BaseDestination {

override func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, file: String, function: String, line: Int, context: Any? = nil) -> String? {
let message = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line, context: context)
#if !DEBUG
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the compiler check to the parent, otherwise cannot write unit tests for this class

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sensible change 👏

Maybe worth doing the same for NSURLErrorNotConnectedToInternet, but presumably this is driven by looking at the reports on Sentry.

@Anderas
Copy link
Contributor Author

Anderas commented Dec 15, 2022

LGTM, sensible change 👏

Maybe worth doing the same for NSURLErrorNotConnectedToInternet, but presumably this is driven by looking at the reports on Sentry.

Yea exactly. And actually network connectivity errors may still be useful to track, because they are not caused / expected by the user, so typically result in some kind of visible error, unlike explicit cancellations.

@Anderas Anderas merged commit bfc32f9 into develop Dec 15, 2022
@Anderas Anderas deleted the andy/cancellation_tracking branch December 15, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants