-
[OPIK-6067] [SDK] fix: surface backend error details on opik connect project retrieval (#6406)
发布于
2026-04-21 14:04:34 +00:00 - [OPIK-6067] [SDK] fix: surface backend error details on opik connect project retrieval
Previously any ApiError raised while resolving the project by name was masked
as "Project '' not found", hiding the real backend reason (for example
"API key should be provided" on 401).Now the SDK formats the error as a single sentence that combines the server's
own message with a status-specific action hint and a link to the configuration
docs. The SDK only contributes the prefix, hint, and a neutral fallback when
the body is empty — the server remains the source of truth for what went
wrong, so no backend text is duplicated.Covers 401/403 (auth/workspace), 404 (project name), and other statuses with
a generic hint. Extraction handles both Dropwizard {"code","message"} and
Opik's {"errors": [...]} error shapes.Implements OPIK-6067: improve error experience when opik connect fails to
retrieve the project by id.- chore(sdk): trim comments on project-retrieval error helpers
Drop the section header and redundant docstrings/comments that restated
what the code does. Keep two short comments that explain the non-obvious
parts: why hints must read as lowercase verb phrases, and which two body
shapes the backend uses.- fix(docs): update broken sdk_configuration URLs to correct path
All references pointed to /tracing/sdk_configuration which 404s.
Updated to /tracing/advanced/sdk_configuration across Python SDK,
TypeScript SDK, and dev scripts.Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
- style: ruff format fixes for long URL lines
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
下载附件