elixir-cloud-aai / drs-filer

Lightweight, flexible Flask/Gunicorn-based GA4GH DRS implementation
Apache License 2.0
5 stars 8 forks source link

feat: clarify error #57

Closed uniqueg closed 2 months ago

uniqueg commented 2 months ago

Description

Change error response from 400 to 409 and return an informative error message if the client attempts to delete the last remaining access method of an object. The OpenAPI specfication was updated accordingly.

Fixes #53

Type of change

Checklist:

Summary by Sourcery

This pull request introduces a new exception AccessMethodNotDeleted to handle cases where the last remaining access method of an object is attempted to be deleted. The DeleteAccessMethod function and related tests have been updated accordingly. Additionally, the API documentation has been updated to reflect the new 409 error response.

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request introduces a new custom exception AccessMethodNotDeleted to handle cases where an attempt is made to delete the last remaining access method of an object. The changes include updates to exception handling, API documentation, and unit tests to reflect this new exception.

File-Level Changes

Files Changes
drs_filer/errors/exceptions.py
drs_filer/ga4gh/drs/server.py
drs_filer/api/additional.data_repository_service.swagger.yaml
tests/ga4gh/drs/test_server.py
Introduced a new exception AccessMethodNotDeleted to handle cases where the last remaining access method of an object is attempted to be deleted. Updated the server logic, API documentation, and unit tests to reflect this new exception.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://sourcery.ai/dashboard): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.