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

Improve handling of invalid pids #31

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Commits on Jul 7, 2023

  1. Improve handling of invalid pids

    If we try to return a item id contained within a list stored in the
    database we currently fail with a 422 Unprocessable Entity. This is not
    very helpful as the client cannot do anything to address this.
    
    To address this we change the process logic to mark a problem with the
    list id by throwing a more general invalid argument exception. This can
    then be caught and handled in different situations where this might 
    occur:
    
    - For situations where the item id is provided by the client we keep
    responding with a 422 error.
    - For situations where the item id is loaded from the database we log
    the error and return any remaining items. 
    
    The situation causing this issue is likely caused by a few faulty items
    being migrated into the database in the initial stage of the project.
    For v2 we have introduced stricter requirements for data formats. These
    are being enforced for new data but cause problems with existing data.
    kasperg committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    e93601e View commit details
    Browse the repository at this point in the history