fix: provide specific error message when notify-send is not installed

This commit is contained in:
NaccOll 2025-08-18 22:42:16 +08:00
parent 17adbc405a
commit 814040a62e

View file

@ -60,7 +60,12 @@ async function showLinuxNotification(options: NotificationOptions): Promise<void
try {
await execa("notify-send", [title, fullMessage])
} catch (error) {
} catch (error: any) {
if (error.code === "ENOENT") {
throw new Error(
"notify-send is not installed. Please install libnotify-bin (apt install libnotify-bin on Debian/Ubuntu)",
)
}
throw new Error(`Failed to show Linux notification: ${error}`)
}
}