EventStore-Client-NodeJS icon indicating copy to clipboard operation
EventStore-Client-NodeJS copied to clipboard

Trying to append an event with wrong id results in UnknownError

Open Imanghvs opened this issue 2 years ago • 5 comments

After calling appendToStream method with an id which is not a uuid, I get this error:

UnknownError: Could not recognize BadRequest

I was in situations where it took a long until I realized I was passing a wrong id through my app. I suggest having a validator on input, so we don't send such requests to EventStore at all (instead we can throw something like InvalidIdException.

I really like to make a PR for id validation, along with related tests if everyone agrees on such a fix.

Imanghvs avatar Oct 21 '23 12:10 Imanghvs

Hi @Imanghvs thank you for reporting this issue and agree with you to provide a better error. Please go ahead and submit a fix and we'll review it.

cdevarenne avatar Oct 23 '23 13:10 cdevarenne