Skip to content

feat: return structured import errors - #3538

Open
TheTisiboth wants to merge 1 commit into
feat/enhance-import-loggingfrom
feat/structured-import-errors
Open

TheTisiboth wants to merge 1 commit into
feat/enhance-import-loggingfrom
feat/structured-import-errors

Conversation

@TheTisiboth

@TheTisiboth TheTisiboth commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Addresses #3279

Depends on #3510 (stacked).

Topic and Scope

Gives users a clear reason when an import fails.

  • Import failures return 400 with {msg, step} (download, parse_html, extract_recipe); missing recipe name included
  • Unexpected errors return 500 with a generic message (details only in the log)
  • Error responses no longer leak file/line (import, create, update)
  • Frontend shows msg for all 4xx import errors
  • API spec (trunk) and API changelog updated

Concerns/issues

API change: clients parsing the plain-string 400 body of a failed import need to read msg.

Formal requirements

  • I did check that the app can still be opened and does not throw any browser logs
  • I created tests for newly added PHP code (check this if no PHP changes were made)
  • I updated the OpenAPI specs and added an entry to the API changelog (check if API was not modified)
  • I notified the matrix channel if I introduced an API change

AI disclosure: prepared with Claude Code (claude-opus-5-5); reviewed by the author.

🤖 Generated with Claude Code

Import failures return {msg, step}, unexpected errors a generic 500, and error responses no longer leak file/line. Frontend and API docs follow the new format.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Léo Jan <leo.jan@doctolib.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR/issue depends on:

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   12 files  ±0    604 suites  ±0   2m 26s ⏱️ -9s
  614 tests +2    606 ✅ +2   8 💤 ±0  0 ❌ ±0 
2 456 runs  +8  2 423 ✅ +8  33 💤 ±0  0 ❌ ±0 

Results for commit 9b83029. ± Comparison against base commit b6befe4.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant