Skip to content

fix: better error messages when game has not been configured - #259

Merged
madebydavid merged 3 commits into
mainfrom
252-bug-error-message-suggests-to-run-shipthis-game-wizard-without-a-platform-arg
Sep 8, 2026
Merged

fix: better error messages when game has not been configured#259
madebydavid merged 3 commits into
mainfrom
252-bug-error-message-suggests-to-run-shipthis-game-wizard-without-a-platform-arg

Conversation

@madebydavid

@madebydavid madebydavid commented Sep 8, 2026

Copy link
Copy Markdown
Member

This is to resolve #252

What's changed

  • centralized getNoGameError which builds one of the more rich oclif errors with suggestions etc with tests
  • When platform is available the recommendations change
  • Applied to shipthis game status and other commands via getGame and baseGameCommand
  • WIZARD_COMMANDS reused in other commands e.g game list

Output

david@sal9000:/tmp/t/empty$ st game status
 ›   Error: No game is set up in this directory.
 ›   Run the wizard for the platform you want to ship to, or name a game you already have with 
 ›   --gameId. Run `shipthis game list` to see your game IDs.
 ›   Try this:
 ›     * shipthis game wizard android
 ›     * shipthis game wizard ios
 ›     * shipthis game status --gameId <id>* shipthis game create --name "My Game"
 ›   Reference: https://shipth.is/docs/create-a-project
david@sal9000:/tmp/t/godot$ st game ship
 ›   Error: No game is set up in this directory.
 ›   Run the wizard for the platform you want to ship to.
 ›   Try this:
 ›     * shipthis game wizard android
 ›     * shipthis game wizard ios
 ›     * shipthis game create --name "My Game"
 ›   Reference: https://shipth.is/docs/create-a-project
david@sal9000:/tmp/t/godot$ 

Also updated when there are no configured platforms for the ship command:

david@sal9000:/tmp/t/fresh$ st game ship

Error: This game has no Android or iOS configuration.
Set up a platform with:

  shipthis game wizard android
  shipthis game wizard ios
david@sal9000:/tmp/t/fresh$ 

I have manually tested all the affected commands

@madebydavid
madebydavid marked this pull request as ready for review September 8, 2026 14:46
@madebydavid
madebydavid requested a balanced review from Copilot September 8, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Some generated recommendations are invalid for shipping or fail to use a platform already encoded in the command.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Centralizes richer no-game errors and replaces invalid bare wizard recommendations with platform-specific commands.

Changes:

  • Adds shared error messaging, suggestions, documentation reference, and tests.
  • Reuses centralized wizard commands across status and list output.
  • Routes game-related commands through the shared error helper.
File summaries
File Description
test/utils/errors.test.ts Tests no-game suggestions and reference URL.
src/utils/errors.ts Builds centralized no-game errors.
src/constants/index.ts Exports command constants.
src/constants/commands.ts Defines wizard, create, and documentation constants.
src/commands/status.tsx Lists platform-specific wizard steps.
src/commands/game/status.tsx Uses the centralized error.
src/commands/game/ship.tsx Uses the centralized error.
src/commands/game/list.tsx Reuses wizard command constants.
src/baseCommands/baseGameCommand.ts Centralizes missing-game handling.
src/baseCommands/baseCommand.ts Adds command-aware no-game reporting.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/baseCommands/baseCommand.ts Outdated
Comment thread src/utils/errors.ts Outdated
Comment thread test/utils/errors.test.ts Outdated
@madebydavid

Copy link
Copy Markdown
Member Author

@copilot - i have pushed fixes for both of the open feedback points
please re-review

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@copilot - i have pushed fixes for both of the open feedback points
please re-review

Reviewed — commit c90ffda addresses both open feedback points: errors.ts now supports a needsProjectConfig option that drops the --gameId suggestion (and swaps in a project-config-specific message) for commands like game ship that read from shipthis.json, and the unclear test comment was reworded. All 167 tests pass and lint is clean (only pre-existing warnings).

@madebydavid

Copy link
Copy Markdown
Member Author

There's another scenario we might want to resolve, running the ship command when we have a godot and shipthis config but the platforms are not configured:

david@sal9000:/tmp/t/godot$ st game ship

Error: No Android or iOS configuration found. Please run `shipthis game wizard android` or `shipthis game wizard ios` to configure your game.

we can clean this up

@madebydavid

Copy link
Copy Markdown
Member Author

That has been updated to show like this:

david@sal9000:/tmp/t/fresh$ st game ship

Error: This game has no Android or iOS configuration.
Set up a platform with:

  shipthis game wizard android
  shipthis game wizard ios
david@sal9000:/tmp/t/fresh$ 

@copilot - can u review again

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

That has been updated to show like this:

...

Reviewed — commit 72bb246 looks good. It reuses WIZARD_COMMANDS from src/constants/commands.ts for the suggestion lines, keeping the message consistent with the rest of the error-handling changes. All 167 tests pass and lint is clean (only pre-existing warnings).

@madebydavid
madebydavid merged commit 1d53820 into main Sep 8, 2026
1 check passed
@madebydavid
madebydavid deleted the 252-bug-error-message-suggests-to-run-shipthis-game-wizard-without-a-platform-arg branch September 9, 2026 12:10
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.

bug: error message suggests to run shipthis game wizard without a platform arg

3 participants