Skip to content

[18.0] [IMP] fastapi: show message for AccessError | MissingError#573

Open
ivantodorovich wants to merge 1 commit intoOCA:18.0from
camptocamp:18.0-imp-fastapi-error-message
Open

[18.0] [IMP] fastapi: show message for AccessError | MissingError#573
ivantodorovich wants to merge 1 commit intoOCA:18.0from
camptocamp:18.0-imp-fastapi-error-message

Conversation

@ivantodorovich
Copy link
Contributor

It's common to raise, for example, MissingError when a related record is not found in a CREATE/WRITE operation.

e.g.: let's say the endpoint allows to create partner, providing the country_code to reference a valid country. If there's no country record with such country_code, we want to raise a MissingError with a meaningful message for the api consumer (e.g.: "No country found with code: %s")

@OCA-git-bot
Copy link
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@ivantodorovich ivantodorovich force-pushed the 18.0-imp-fastapi-error-message branch from 54f3f87 to 197c2e0 Compare November 3, 2025 12:28
@lmignon
Copy link
Contributor

lmignon commented Nov 3, 2025

Thank you for the proposals @ivantodorovich. I understand the need. The current approach is very defensive and aims to avoid revealing the structure of the expected message in any way. In absolute terms, I am not against this change, Nevertheless this is a subject on which I would like to gather the opinions of as many people as possible.

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants