Skip to content

Commit 12a4ee7

Browse files
committed
Fix catching another exceptions types
1 parent 6933132 commit 12a4ee7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/amrdeveloper/linkhub/util/LinkBottomSheetDialog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.amrdeveloper.linkhub.util
22

33
import android.app.Activity
4-
import android.content.ActivityNotFoundException
54
import android.content.ClipData
65
import android.content.ClipboardManager
76
import android.content.Context
@@ -43,7 +42,8 @@ object LinkBottomSheetDialog {
4342
dialogBinding.dialogOpenAction.setOnClickListener {
4443
try {
4544
openLinkIntent(activity, link.url)
46-
} catch (e: ActivityNotFoundException) {
45+
} catch (_: Exception) {
46+
// TODO: improve error message, and replace try catch with tag union errors
4747
activity.showSnackBar(R.string.message_link_invalid)
4848
}
4949
bottomSheetDialog.dismiss()

0 commit comments

Comments
 (0)