protected internal async Task <UpdateResult> UpdateAsync(IEnumerable <IComponent> components, CancellationToken cancellation) { cancellation.ThrowIfCancellationRequested(); Logger.Trace("Performing update..."); var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellation); var operation = new UpdateOperation(components); try { await Task.Run(() => { operation.Schedule(); operation.Run(cts.Token); }, cts.Token).ConfigureAwait(false); return(UpdateResult.Success); } catch (OperationCanceledException e) { Logger.Error(e, $"Cancelled update: {e.Message}"); throw; } catch (ComponentFailedException e) { Logger?.Error(e, "Component Failed to update"); throw; } catch (Exception e) { Logger.Error(e, $"Failed update: {e.Message}"); throw; } }