Background
PR #103 added mode-aware dispatch to nine `app` commands. Each site emits its own error for the "no marker" and "no CURRENT_SLOT" states, using different phrasing:
| Site |
Message |
| `deploy.go:60` (no-proxy) |
`app %q not initialized on this server — run 'conoha app init --no-proxy --app-name %s %s' first` |
| `deploy.go:171` (proxy) |
`app %q not initialized on this server — run 'conoha app init %s' first` |
| `rollback.go:56` |
`app %q not initialized on this server — run 'conoha app init' first` |
| `logs/stop/restart/status` |
`app %q has not been initialized on this server` (no recovery hint) |
| `logs/stop/restart` (slot check) |
`app %q has not been deployed on this server` |
| `formatModeConflictError` (mode.go:73) |
`... # re-initialize in %s mode` — embeds a literal `` token rather than the real server ID |
Proposal
Add two helpers in `cmd/app/mode.go`:
```go
// notInitializedError returns the canonical error for "no .conoha-mode marker".
// If mode is non-empty, the recovery hint includes the right --no-proxy flag.
func notInitializedError(app, serverID string, mode Mode) error
// notDeployedError returns the canonical error for "marker present but
// CURRENT_SLOT absent" (= app was never deployed).
func notDeployedError(app string) error
```
Also thread `serverID` through `formatModeConflictError` so the printed recovery commands reference the actual server.
Acceptance
- All "not initialized" / "not deployed" errors across the `app` subcommands go through one helper each.
- `formatModeConflictError` prints the real server ID instead of ``.
- Tests updated to assert the new helper output.
Pointer
Surfaced by review on PR #103 (items M1, M2).
Background
PR #103 added mode-aware dispatch to nine `app` commands. Each site emits its own error for the "no marker" and "no CURRENT_SLOT" states, using different phrasing:
Proposal
Add two helpers in `cmd/app/mode.go`:
```go
// notInitializedError returns the canonical error for "no .conoha-mode marker".
// If mode is non-empty, the recovery hint includes the right --no-proxy flag.
func notInitializedError(app, serverID string, mode Mode) error
// notDeployedError returns the canonical error for "marker present but
// CURRENT_SLOT absent" (= app was never deployed).
func notDeployedError(app string) error
```
Also thread `serverID` through `formatModeConflictError` so the printed recovery commands reference the actual server.
Acceptance
Pointer
Surfaced by review on PR #103 (items M1, M2).