Skip to content

Commit

Permalink
feat: Do not log NameNotFoundException to sentry when saving to kDrive
Browse files Browse the repository at this point in the history
When saving an email to kDrive, we check if the app is installed on the device. To know that the app is not installed, we need to catch a NameNotFoundException. This is an expected behavior and doesn't need to be logged to sentry
  • Loading branch information
LunarX committed Mar 10, 2025
1 parent 5930a1c commit 2c3674b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2024 Infomaniak Network SA
* Copyright (C) 2024-2025 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,7 +19,6 @@ package com.infomaniak.mail.utils

import android.content.Context
import android.content.pm.PackageManager
import io.sentry.Sentry

object SaveOnKDriveUtils {
const val DRIVE_PACKAGE = "com.infomaniak.drive"
Expand All @@ -29,7 +28,6 @@ object SaveOnKDriveUtils {
val packageInfo = context.packageManager.getPackageInfo(DRIVE_PACKAGE, PackageManager.GET_ACTIVITIES)
packageInfo.activities.any { it.name == SAVE_EXTERNAL_ACTIVITY_CLASS }
}.getOrElse {
Sentry.captureException(it)
false
}
}

0 comments on commit 2c3674b

Please sign in to comment.