Skip to content

fix: accept the status message returned when attaching a domain - #10

Merged
sebartyr merged 1 commit into
mainfrom
fix/create-domain-message-body
Sep 23, 2026
Merged

sebartyr merged 1 commit into
mainfrom
fix/create-domain-message-body

Conversation

@sebartyr

Copy link
Copy Markdown
Member

Summary

create_domain() (added in 0.2.1) failed on every real call: the PUT /v2/organisations/{ownerId}/applications/{appId}/vhosts/{vhost} endpoint answers with a status message ({"id", "message", "type"}), not the vhost, and the method parsed it as a Domain, raising InvalidResponseError even though the domain was attached. The tests mocked a {"fqdn": …} body, which hid it.

Reported with a proposed fix in #9.

Changes

  • Empty body: unchanged, Domain built from the requested name.
  • Body with fqdn: unchanged, parsed as before.
  • Status message: accepted, Domain built from the requested name.
  • Status message with "type": "error": raises InvalidResponseError with the message, instead of being reported as a success.
  • Any other body: raises InvalidResponseError, consistent with strict parsing since 0.2.0.
  • Docstring, CHANGELOG (Unreleased) and three tests.

Test plan

  • uv run ruff check .
  • uv run mypy
  • uv run pytest

🤖 Generated with Claude Code

The vhost PUT endpoint answers with a status message ({"id", "message",
"type"}), not the vhost, so create_domain() raised InvalidResponseError on
every real call. The message is now accepted and the returned Domain
carries the requested name; a message of type "error" raises
InvalidResponseError instead of being reported as a success.

Reported in #9.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sebartyr
sebartyr merged commit e0a4301 into main Sep 23, 2026
4 checks passed
@sebartyr sebartyr mentioned this pull request Sep 23, 2026
3 tasks
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