Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 11338da

Browse files
authored
Merge branch 'master' into fixes/2110-ExtrasEnableDefaultResourceItems-false
2 parents 343e88f + 28fc322 commit 11338da

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/GitHub.Exports.Reactive/ViewModels/ViewModelBase.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
2-
using GitHub.UI;
2+
using System.Reactive;
3+
using GitHub.Logging;
34
using ReactiveUI;
5+
using Serilog;
46

57
namespace GitHub.ViewModels
68
{
@@ -13,5 +15,15 @@ namespace GitHub.ViewModels
1315
/// </remarks>
1416
public abstract class ViewModelBase : ReactiveObject, IViewModel
1517
{
18+
static readonly ILogger logger = LogManager.ForContext<ViewModelBase>();
19+
20+
static ViewModelBase()
21+
{
22+
// We don't really have a better place to hook this up as we don't want to force-load
23+
// rx on package load.
24+
RxApp.DefaultExceptionHandler = Observer.Create<Exception>(
25+
ex => logger.Error(ex, "Unhandled rxui error"),
26+
ex => logger.Error(ex, "Unhandled rxui error"));
27+
}
1628
}
1729
}

0 commit comments

Comments
 (0)