8000 Distinguish error-handling for bulk-imports · Issue #1194 · kadai-io/kadai · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Distinguish error-handling for bulk-imports #1194
@bruderj15

Description

@bruderj15

Follow-Up to #855

Description

Currently some API-Elements - primarily REST-Endpoints for Bulk-Imports - require all items in the bulk input to be unique.
If there are any logical duplicates (some identical key), it fails with a 409 CONFLICT and error-code e.g. CLASSIFICATION_ALREADY_EXISTS.

Http- and Error-Code are both misleading.
The semantics of the latter are overloaded with use cases where insertion of an item into the database fails because the item actually already exists.

Therefore, add a new Error-Type and -Code.

Currently, below occurences are known:

  • ClassificationDefinitionController::importClassifications
  • WorkbasketDefinitionController::importWorkbaskets
  • WorkbasketService::setWorkbasketAccessItems

Definition of Done

  • Checked for other occurences of the misleading usage of [Entity]AlreadyExistException
  • Added a new exception for invalid payloads due to logical duplicates
    • Added Java-Type
    • Added Error-Code
    • Added Contract-Test for Error-Code
  • Affected REST-Endpoints now respond with 400 BAD_REQUEST if the payload contains logical duplicates
  • Affected REST-Endpoints now respond with the new Error-Code if the payload contains logical duplicates
  • Added tests for the new behaviour & adjusted affected tests

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0