7. Error handling & toasts #8

Closed
opened 2026-05-16 01:39:55 +00:00 by jtmorris · 1 comment
Owner

Parent: PRD #1 (Tailscale Widget Plugin for Dank Bar)

Type: AFK

Blocked by: #4

Ensure all tailscale CLI failures are surfaced to the user via ToastService and that the widget degrades gracefully.

Acceptance Criteria

  • Any non-zero exit code from tailscale up/down/set/status triggers ToastService.showError with a short message
  • The bar pill falls back to the disconnected icon/state when status cannot be read
  • The popout shows a friendly “Tailscale not available” message instead of crashing when the binary is missing
  • No unhandled promise rejections or console spam

Notes

This slice hardens the plugin for real-world use (missing binary, permission issues, etc.).

Parent: PRD #1 (Tailscale Widget Plugin for Dank Bar) **Type:** AFK **Blocked by:** #4 Ensure all `tailscale` CLI failures are surfaced to the user via `ToastService` and that the widget degrades gracefully. ## Acceptance Criteria - Any non-zero exit code from `tailscale up/down/set/status` triggers `ToastService.showError` with a short message - The bar pill falls back to the disconnected icon/state when status cannot be read - The popout shows a friendly “Tailscale not available” message instead of crashing when the binary is missing - No unhandled promise rejections or console spam ## Notes This slice hardens the plugin for real-world use (missing binary, permission issues, etc.).
Collaborator

Summary

Implemented error handling and toast notifications for the Tailscale widget:

lib.js

  • Added errorMessage(cmd) utility that returns user-friendly toast messages for each tailscale subcommand (up, down, set, status), with a fallback for unknown commands

TailscaleWidget.qml

  • toggleProcess.onExited shows toast on non-zero exit with appropriate connect/disconnect message
  • statusCheck.onExited shows toast on non-zero exit; detects exit code 127 (binary not found) and sets binaryAvailable to false
  • toggleTailscale() and setExitNode() guard against calling when binary is unavailable
  • Popout shows 'Tailscale not available' message when binary is missing

Tests

  • Added 5 new tests for errorMessage covering all command types and fallback case
  • All 8 tests passing

Commit: 6129b09

## Summary Implemented error handling and toast notifications for the Tailscale widget: **lib.js** - Added errorMessage(cmd) utility that returns user-friendly toast messages for each tailscale subcommand (up, down, set, status), with a fallback for unknown commands **TailscaleWidget.qml** - toggleProcess.onExited shows toast on non-zero exit with appropriate connect/disconnect message - statusCheck.onExited shows toast on non-zero exit; detects exit code 127 (binary not found) and sets binaryAvailable to false - toggleTailscale() and setExitNode() guard against calling when binary is unavailable - Popout shows 'Tailscale not available' message when binary is missing **Tests** - Added 5 new tests for errorMessage covering all command types and fallback case - All 8 tests passing Commit: 6129b09
vybe closed this issue 2026-05-18 21:06:16 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jtmorris/dms_tailscalectl#8
No description provided.