Skip to content

Suggest ENTROPY_DATA_HOST on failed business definition IRI lookups#1333

Open
simonharrer wants to merge 1 commit into
mainfrom
fix/iri-host-mismatch-hint
Open

Suggest ENTROPY_DATA_HOST on failed business definition IRI lookups#1333
simonharrer wants to merge 1 commit into
mainfrom
fix/iri-host-mismatch-hint

Conversation

@simonharrer

Copy link
Copy Markdown
Contributor

Summary

When a business definition reference is an IRI whose host does not match the configured entropy-data host, the /api/semantics lookup often fails with a 401/403 (or a missing API key). Previously the error pointed only at the API key, leaving users to guess that the host was actually wrong.

This change surfaces a copy-pasteable ENTROPY_DATA_HOST=... hint — derived from the IRI's own host — on these failures:

  • Missing API key for an IRI lookup
  • 401/403 responses from /api/semantics
  • Transport errors during the IRI lookup

Changes

  • _build_request now also returns an optional host hint for the off-host IRI case.
  • New _host_mismatch_hint builds the actionable, copy-pasteable suggestion.
  • _definition_resolution_error accepts a hint appended to the error message.

Testing

  • Added test_semantics_iri_403_suggests_setting_host and extended the missing-API-key test to assert the host hint.
  • pytest tests/test_resolve_definitions.py — 23 passed.

@simonharrer simonharrer requested a review from andredlng June 22, 2026 22:30
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