File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
src/ReactiveDomain.Foundation/StreamStore Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,9 @@ public virtual bool Read(
151
151
Ensure . Nonnegative ( ( long ) checkpoint , nameof ( checkpoint ) ) ;
152
152
if ( count != null )
153
153
Ensure . Positive ( ( long ) count , nameof ( count ) ) ;
154
- if ( ! ValidateStreamName ( streamName ) )
155
- throw new ArgumentException ( "Stream not found." , streamName ) ;
156
-
154
+ if ( ! ValidateStreamName ( streamName ) )
155
+ return false ;
156
+
157
157
_cancelled = false ;
158
158
FirstEventRead = false ;
159
159
StreamName = streamName ;
@@ -191,8 +191,17 @@ public virtual bool Read(
191
191
/// <param name="streamName">The stream name to validate.</param>
192
192
public bool ValidateStreamName ( string streamName )
193
193
{
194
- var currentSlice = _streamStoreConnection . ReadStreamForward ( streamName , 0 , 1 ) ;
195
- return ! ( currentSlice is StreamDeletedSlice ) ;
194
+ try
195
+ {
196
+ var result = _streamStoreConnection . ReadStreamForward ( streamName , 0 , 1 ) ;
197
+
198
+ return result . GetType ( ) == typeof ( StreamEventsSlice ) ;
199
+ }
200
+ catch ( Exception )
201
+ {
202
+ return false ;
203
+ }
204
+
196
205
}
197
206
198
207
protected virtual void EventRead ( RecordedEvent recordedEvent )
You can’t perform that action at this time.
0 commit comments