Enhance/cnav 404 is 502 - #321
Merged
Merged
Conversation
… 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
marked this pull request as ready for review
August 6, 2026 10:56
skelz0r
approved these changes
Aug 6, 2026
skelz0r
left a comment
Member
There was a problem hiding this comment.
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é.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.