Skip to content

Enhance/cnav 404 is 502 - #321

Merged
Samuelfaure merged 2 commits into
developfrom
enhance/cnav_404_is_502
Aug 6, 2026
Merged

Enhance/cnav 404 is 502#321
Samuelfaure merged 2 commits into
developfrom
enhance/cnav_404_is_502

Conversation

@Samuelfaure

Copy link
Copy Markdown
Contributor

No description provided.

… errors

CNAV::ValidateResponse#resource_not_found! fell back to a generic
NotFoundError (404, "Une erreur inattendue...") whenever a 404 wasn't
attributable to a known sub-provider (SNGI/RNCPS) or regime (CNAF/MSA).
This misrepresented an unrecognized provider response as a resource
lookup failure. Reuse the unknown_provider_response! helper already
used elsewhere in this class to raise ProviderUnknownError instead,
which is tracked to Sentry and maps to 502/503 depending on API
version. Applies to all 8 CNAV endpoints, which share this base class.

Updated matching organizer and request specs, moving the "unexpected
CNAV error" rswag example from each endpoint's 404 block into its
503 (v2) or a new 502 (v3) block, preserving real end-to-end coverage
via stub_cnav_404 rather than just asserting on a mocked organizer.
Run siade/bin/generate_swagger.sh to reflect the previous commit:
unattributed CNAV 404s now document as ProviderUnknownError under
their endpoint's 502 (v3)/503 (v2) response instead of under 404.
@Samuelfaure
Samuelfaure marked this pull request as ready for review August 6, 2026 10:56
@Samuelfaure
Samuelfaure requested review from Un3x and skelz0r August 6, 2026 10:56

@skelz0r skelz0r left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg tout ça pour 4 lignes 🤯

faudrait simplifier quand même, genre avec un auto enhanced post generation sur le swagger parce que là ça fait N tests à tourner pour un truc déjà testé.

@Samuelfaure
Samuelfaure merged commit 7f9d33d into develop Aug 6, 2026
27 checks passed
@Samuelfaure
Samuelfaure deleted the enhance/cnav_404_is_502 branch August 6, 2026 12:11
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.

2 participants