From 063df2cbea70cb71d362c29a5ca4f525825e9e07 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Wed, 28 Mar 2018 17:51:06 -0400 Subject: [PATCH] Posting to the bus should always be "safe" for the caller --- src/client/spark/core/Bus/SingletonBus.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/spark/core/Bus/SingletonBus.cs b/src/client/spark/core/Bus/SingletonBus.cs index 284dabf14..21346dd05 100644 --- a/src/client/spark/core/Bus/SingletonBus.cs +++ b/src/client/spark/core/Bus/SingletonBus.cs @@ -1,4 +1,5 @@ using bts.api; +using mbts; using mbts.utils; using System; using System.Collections.Generic; @@ -27,7 +28,12 @@ namespace bts.core } public void post(ITag tag, T data) { - subject(tag).OnNext(data); + try { + subject(tag).OnNext(data); + } + catch(Exception e) { + Logger.error(log.Subsystem.Ui, $"Exception posting to '{tag}': {e}"); + } } public IObservable subscribe(ITag tag) {