Skip to content

AAI-289 Add a more useful response for registration errors#51

Merged
marius-mather merged 16 commits into
mainfrom
registration-errors
Aug 21, 2025
Merged

AAI-289 Add a more useful response for registration errors#51
marius-mather merged 16 commits into
mainfrom
registration-errors

Conversation

@marius-mather

@marius-mather marius-mather commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator

Description

AAI-289: add an error response for registration requests that's easier to use in the frontend. Where possible, the response should specify which fields have errors and individual error messages for them.

Changes

  • Add a RegistrationErrorResponse that is returned (with status code 400) for registration errors.
  • Use RegistrationErrorResponse in registration endpoints
  • Add a custom route handler so we can override FastAPI's default validation to raise the error in the format we want
  • Update tests

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)

How to Test Manually (if necessary)

Run uv run pytest

amandazhuyilan
amandazhuyilan previously approved these changes Aug 20, 2025

@amandazhuyilan amandazhuyilan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good - I’ll also try some errors out once this is merged!

@marius-mather

Copy link
Copy Markdown
Collaborator Author

@amandazhuyilan we still need to update the frontend to use these errors - but they should all come back in a sensible format now

@marius-mather marius-mather merged commit 0a52781 into main Aug 21, 2025
2 checks passed
@amandazhuyilan amandazhuyilan deleted the registration-errors branch June 19, 2026 03:22
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.

3 participants