Skip to content

Commit d76d9e0

Browse files
authored
Merge pull request #182 from badmannersteam/init_failure_catch
Fixed init exception handling - also catching Throwable to handle UnsatisfiedLinkError
2 parents 3083a57 + 0506510 commit d76d9e0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/commonMain/kotlin/com/kdroid/composetray/tray/api

src/commonMain/kotlin/com/kdroid/composetray/tray/api/NativeTray.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ internal class NativeTray {
106106

107107
else -> {}
108108
}
109-
} catch (e: Exception) {
110-
Log.e("NativeTray", "Error initializing tray:", e)
109+
} catch (th: Throwable) {
110+
Log.e("NativeTray", "Error initializing tray:", th)
111111
}
112112

113113
val awtTrayRequired = os == MACOS || os == UNKNOWN || !trayInitialized
@@ -117,8 +117,8 @@ internal class NativeTray {
117117
Log.d("NativeTray", "Initializing AWT tray with icon path: $iconPath")
118118
AwtTrayInitializer.initialize(iconPath, tooltip, primaryAction, menuContent)
119119
awtTrayUsed.set(true)
120-
} catch (e: Exception) {
121-
Log.e("NativeTray", "Error initializing AWT tray:", e)
120+
} catch (th: Throwable) {
121+
Log.e("NativeTray", "Error initializing AWT tray:", th)
122122
}
123123
} else {
124124
Log.d("NativeTray", "AWT tray is not supported")

0 commit comments

Comments
 (0)