Skip to content

fix(cli): silent-exit when no server running — routes, reload, test, console #2229

@bpamiri

Description

@bpamiri

GA blocker (Bucket A3 in audit)

Several LuCLI commands return an empty string when no Wheels server is detected, printing a red message via `out()` but exiting with code 0. MCP clients and automation scripts cannot distinguish "command succeeded with no output" from "command failed because server is down".

Recent PRs (#2211, #2214, #2215, #2223) fixed silent-exit paths in `wheels new` and `wheels doctor`, but these commands were missed.

Evidence

Each returns `""` after an `out(...red)` call without throwing.

Fix

  • Introduce a shared `$requireRunningServer()` helper (or typed exception `WheelsServerNotRunning`) in BaseModule or Module.cfc.
  • Replace silent returns in `routes`, `reload`, `runTests`, `console` (and any others surfaced by audit) to throw the exception.
  • Let LuCLI's error handler map the exception to a non-zero exit code + clear message.
  • Add e2e test coverage: invoke each command with no server, assert non-zero exit.

Acceptance

  • `wheels routes` with no server → exit 1, clear error.
  • `wheels reload`, `wheels test`, `wheels console` same.
  • Existing silent-exit coverage in `cli/tests/specs/e2e/` extended to catch regressions.

Refs: GA audit doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugphase:1-stabilizeBugs, cleanup, CI fixes — tackle first

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions