Skip to content

Delete assigned resource must return HTTP status code 409 Conflict#693

Open
stiliyan-v wants to merge 2 commits into
mainfrom
fix/issue-692_delete-assigned-location-returns-409
Open

Delete assigned resource must return HTTP status code 409 Conflict#693
stiliyan-v wants to merge 2 commits into
mainfrom
fix/issue-692_delete-assigned-location-returns-409

Conversation

@stiliyan-v

Copy link
Copy Markdown
Contributor

Changes Made:

  • Added the new exception class CompasAssignedLocationException for cases when a location with assigned resources is attempted to be deleted.
  • Updated LocationsService.deleteLocation to throw CompasAssignedLocationException instead of the more generic CompasSclDataServiceException when deletion is not allowed.
  • Introduced CompasAssignedLocationExceptionHandler to map CompasAssignedLocationException to a 409 Conflict HTTP response with a structured error body.

Testing Updates:

  • Added a unit test for CompasAssignedLocationExceptionHandler to verify correct error response mapping.
  • Updated service and resource tests to expect and use CompasAssignedLocationException instead of the previous exception.

…d location

Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
@stiliyan-v stiliyan-v self-assigned this Jul 9, 2026
@stiliyan-v
stiliyan-v requested a review from a team as a code owner July 9, 2026 13:28
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.

Deleting a location assigned to resources returns 500 instead of 409 Conflict

1 participant