do not crash when a conenction can not be done

This commit is contained in:
l_samenv
2025-02-13 10:58:28 +01:00
parent 77af8c760e
commit 832252bbbb
2 changed files with 7 additions and 4 deletions

View File

@ -263,8 +263,11 @@ class EventStream:
if not isinstance(stream, Stream):
for streamcls, uri, kwargs in stream.events():
if uri not in self.streams:
print('add stream', uri, kwargs)
self.streams[uri] = streamcls(uri, **kwargs)
try:
self.streams[uri] = streamcls(uri, **kwargs)
print('added stream', uri, kwargs)
except Exception as e:
print('can not connect to', uri, repr(e))
for name, stream in self.streams.items():
try:
if stream.get_events(events, maxevents):