Skip to content

Name the request in a Management API error the document does not describe - #8

Merged
curquiza merged 1 commit into
management-projectsfrom
management-url-host
Oct 15, 2026
Merged

curquiza merged 1 commit into
management-projectsfrom
management-url-host

Conversation

@curquiza

@curquiza curquiza commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Important

On hold. The Management API is changing: a project's masterKey will no longer be returned by GET /projects, only at creation if at all, and a better error handling is in progress. This pull request waits for those decisions, then follows them. Design discussion in progress on how --project and the config file identify a Cloud project.

What

Name the request in a Management API error the document does not describe, so that a wrong base URL shows in the error itself. Stacked on #7, which it needs.

Found by hand: MEILI_MANAGEMENT_URL=https://api.meilisearch.dev/api/v2 made the client call …/api/v2/api/v2/projects, which answers 404 with no body, and the CLI said only "The Management API answered HTTP 404." It now says "The Management API answered HTTP 404 to POST https://api.meilisearch.dev/api/v2/api/v2/projects." The URL's format is not checked: the error says what was called, the user decides.

Contract

  • No command or flag changes; this pull request changes output.md with the code that implements it
  • Output goes through src/lib/output.ts, errors through src/lib/errors.ts
  • The command never waits for a human
  • The command never speaks HTTP itself

Tests

  • --help snapshot: unchanged
  • JSON output snapshot: unchanged; the message is unit-tested in test/lib/errors.test.ts
  • Integration test: not applicable
  • pnpm lint, pnpm typecheck, pnpm test pass locally

Simplicity

  • Nothing in the diff exists for a case the API cannot produce, a caller that does not exist, or a generality nobody asked for (rule 16)
  • Shared code in src/lib/: ManagementApiError takes the request, given by the error interceptor of clients/management.ts

Docs

  • output.md: the message of a status the spec describes neither by body nor by description is the status and the request
  • No accepted ADR was edited

Housekeeping

  • oclif.manifest.json: unchanged
  • Changeset: nothing to add, the first version's line on structured errors covers it
  • No new dependency

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 9e5ca66c-0722-4456-92b9-5c3d7ad2f215

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…ribe

MEILI_MANAGEMENT_URL set to https://api.meilisearch.dev/api/v2 made the
client call /api/v2/api/v2/projects, which answers 404 with no body, and
the CLI said only "answered HTTP 404". The message now carries the
request, "HTTP 404 to POST https://…/api/v2/api/v2/projects", so that
the doubled prefix shows. No check on the URL's format: the error says
what was called, the user decides.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@curquiza
curquiza force-pushed the management-url-host branch from 6ba98a8 to a654620 Compare October 15, 2026 09:27
@curquiza curquiza changed the title Refuse a Management API URL with a path, and name the request in a bare 404 Name the request in a Management API error the document does not describe Oct 15, 2026
@curquiza
curquiza merged commit cb479ba into management-projects Oct 15, 2026
3 checks passed
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.

1 participant