// Just a helper function. protected Task <Exception> NotifyHostOnUnhandledExceptionAsync(Exception exception, Activity source) => ExecuteWithExceptionTrackingAsync(async() => { await IfHasPendingThenFlushTrackingRecordsAsync(); await host.OnUnhandledExceptionAsync(exception, source); });