check if a stream exists


whenever i try to read from or append to a stream if it does not exists it throws an exception. ¿Is there any way to check the existence of the stream before read or append, to avoid the exception?

It depends what you set the expected version to. If you say
Version.Any or 0 it will create the stream for you on append.

that will do for the appends but ¿for the reads?

Hi bogomez,

It’s a question about Exceptions vs Error Codes.

In our client API we throw exceptions to indicate errors/invalid usage.

Вівторок, 13 листопада 2012 р. 13:04:18 UTC+2 користувач bogomez написав:

We are considering possibility to add new method to api - [bool StreamExists]

for such purposes

Вівторок, 13 листопада 2012 р. 16:30:57 UTC+2 користувач taras.roshko написав:

Ok, thanks.

Hi again,

ReadEventStream[Forward/Backward] in dev branch now return EventStreamSlice with additional Status property which can be [Success, StreamDeleted, StreamNotFound],

no exceptions are thrown when stream does not exists or was deleted.

Вівторок, 13 листопада 2012 р. 16:59:21 UTC+2 користувач bogomez написав: