Posting to the bus should always be "safe" for the caller

This commit is contained in:
Eric Harding committed 2018-03-28 17:51:06 -04:00
1 parent 3c44f0746b
commit 063df2cbea
1 file changed
+7 -1
+7 -1
View File
@@ -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<T>(ITag<T> tag, T data) {
subject<T>(tag).OnNext(data);
try {
subject<T>(tag).OnNext(data);
}
catch(Exception e) {
Logger.error(log.Subsystem.Ui, $"Exception posting to '{tag}': {e}");
}
}
public IObservable<T> subscribe<T>(ITag<T> tag) {