Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better dataspace error message parsing #89

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

lsipii
Copy link
Contributor

@lsipii lsipii commented Nov 30, 2023

Dataspace returns a couple of different types of errors. The primary error payload is a simple {type: string, message: string}, but for validation errors (422) dataspace uses the pythonic structure {detail: [{ msg: string, type: string, loc: string[] }]}.

This PR updates the af-mvp app-error parsing regarding the 422-validation errors, so that the resulting alerts indicate the specific error right away.

Copy link
Collaborator

@LauriGofore LauriGofore left a comment

Choose a reason for hiding this comment

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

Tämä näyttää hyvältä parsalta. 👍 Vähän yritin saada noita dataspace erroreita triggeröidyksi, mutta kun meillä on välissä hyvää validaatiota niin en äkkiseltään keksinyt, miten pääsisi "sinne asti", ilman että alkais softaa riisumaan aseista. Sikäli hyvä juttu, että toimii siltä osalta.

Olisin tarkistanut miten joissain kohdin UI:lla käyttäytyy, mutta luetun perusteella pitäisi kyllä toimia. 👍

@lsipii
Copy link
Contributor Author

lsipii commented Dec 4, 2023

Olisin tarkistanut miten joissain kohdin UI:lla käyttäytyy, mutta luetun perusteella pitäisi kyllä toimia. 👍

Voisi mokkailemalla saada viestiä näytille, mutta päällimmäisen muutoksen pitäisi olla että kun ennen kun viestinä oli Request failed with status code 422 niin nyt tämän jälkeen viestin pitäsi olla mallia <type>: <message> eli esim. ValidationException: Residency is not valid.

@lsipii lsipii merged commit 2128ee3 into main Dec 5, 2023
2 checks passed
@lsipii lsipii deleted the feat/better-dataspace-error-response-parsing branch December 7, 2023 15:02
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.

None yet

2 participants