yevhen / Streamstone

Event store for Azure Table Storage
Other
395 stars 64 forks source link

UnexpectedStorageResponseException for duplicates with CosmosDB emulator #56

Closed lethek closed 5 years ago

lethek commented 5 years ago

I've been trying the example scenarios from this repo with the CosmosDB Emulator. However, I have not yet tried it with the real CosmosDB.

When I got to the S09_Handling_duplicates scenario, an UnexpectedStorageResponseException was thrown by Streamstone.Stream.WriteOperation.Batch.ParseConflictingEntityPosition with the message "Unexpected Table Storage response. Details: Conflict exception message should have exactly 3 lines".

The exception's wrapped Error.ErrorMessage string looks okay to me except that it's actually 4 lines rather than 3 because it has a trailing new-line character on the end.

4:The specified entity already exists.

RequestID:e1be4a0d-1abd-4df2-be6f-bb71d35cfb5f
yevhen commented 5 years ago

So we just need to trim trailing newline before check, right?

Can you do a PR on this?

lethek commented 5 years ago

I believe so. I'm happy to give it a try making a PR a bit later today.