Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940import Foundation
struct AppFixtureMenuFailure: Error, LocalizedError, Equatable { enum Stage: String, CaseIterable, Sendable { case eligibility, arguments, runtime, permission, heldInput, display, workspace, eventCreation case presentation, selectionDispatch, capture, selection, cursorMovement, cursorRestoration
var message: String { let key = switch self { case .eligibility: "Fixture menu input requires a fixture-only app in e2e mode." case .arguments: "Fixture menu input needs a display and a window count from 1 to 5." case .runtime: "The fixture menu has no running engine or status item." case .permission: "Fixture menu input requires permission to post events." case .heldInput: "Fixture menu input is blocked by a held mouse button or modifier." case .display: "The fixture menu target is not on the status item’s display." case .workspace: "The fixture menu target has no active workspace with windows." case .eventCreation: "The fixture menu click events could not be created." case .presentation: "The fixture menu did not open within five seconds." case .selectionDispatch: "The fixture menu built its items, but the scheduled selection did not run." case .capture: "The fixture menu image could not be captured." case .selection: "The requested fixture menu item is missing or disabled." case .cursorMovement: "The fixture menu could not move the pointer." case .cursorRestoration: "The fixture menu could not restore the pointer." } return AppText.string(key) } }
let stage: Stage var errorDescription: String? { stage.message }
static func windowCount(_ arguments: [String]) throws -> Int { guard arguments.count == 2, !arguments[0].isEmpty, let count = Int(arguments[1]), (1...5).contains(count) else { throw Self(stage: .arguments) } return count }}