Skip to content

Forward errors to CLI when using tophatctl#123

Merged
lfroms merged 1 commit intomainfrom
tophatctl-errors
Mar 10, 2026
Merged

Forward errors to CLI when using tophatctl#123
lfroms merged 1 commit intomainfrom
tophatctl-errors

Conversation

@lfroms
Copy link
Member

@lfroms lfroms commented Mar 10, 2026

What does this change accomplish?

This change updates how errors are displayed when using tophatctl. Previously, tophatctl was purely a remote control for the UI, so all errors were displayed as AppKit alerts. With this change, errors are no longer displayed in the UI for tophatctl-triggered operations and are instead printed to the command line, along with nonzero exit code.

How have you achieved it?

  • By using InstallCoordinator directly in remoteControlReceiver delegate methods since InstallAppAction is purely for UI-initiated installs.
  • By extracting some recipe constructing logic into extensions to avoid duplicating between delegate method implementations and the InstallAppAction.
  • By extracting the error message formatting logic into a shared type so that the existing ErrorNotifier and RemoteControlReceiver (which now returns the error messages in the reply) can both use it.
  • By updating the receiver and Install command accordingly to send/receive the error data.

How can the change be tested?

Run tophatctl with input that will cause installation to fail and ensure that the error message is printed to the CLI with nonzero exit. Also ensure that existing installation flows that produce error (especially UI-initiated) are still working and display errors in UI alerts.

@lfroms lfroms self-assigned this Mar 10, 2026
@lfroms lfroms force-pushed the tophatctl-errors branch from c90939c to 7183f11 Compare March 10, 2026 01:05
Base automatically changed from specific-device-tophatctl to main March 10, 2026 17:30
@lfroms lfroms force-pushed the tophatctl-errors branch 2 times, most recently from af47cbd to d7c1532 Compare March 10, 2026 17:36
@lfroms lfroms force-pushed the tophatctl-errors branch from d7c1532 to ea85e19 Compare March 10, 2026 17:40
@lfroms lfroms merged commit 24714d5 into main Mar 10, 2026
3 checks passed
@lfroms lfroms deleted the tophatctl-errors branch March 10, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants