johanhaleby / occurrent

Unintrusive Event Sourcing Library for the JVM
https://occurrent.org
125 stars 16 forks source link

translateToDuplicateCloudEventException should not return "DuplicateCloudEventException" when another index is the cause of MongoBulkWriteException #65

Closed johanhaleby closed 3 years ago

johanhaleby commented 3 years ago

To reproduce:

  1. Create a unique index in mongodb (something in the data field)
  2. Write two events with different id and source

Expected: MongoBulkWriteException

Actual: DuplicateCloudEventException(null, null)

johanhaleby commented 3 years ago

Adding "details" message to DuplicateCloudEventException instead