private bool Set(IMitigation mitigation, int pos) { bool result = false; var status = GetPaletteWorkItemStatus(pos); try { _loading = true; DevOpsManager.SetMitigationsStatusAsync(mitigation, status); result = true; } catch (WorkItemCreationException) { MoveItem(mitigation, status, WorkItemStatus.Unknown); ShowWarning?.Invoke($"Mitigation creation failed.\nPlease wait a few moments and retry, because the problem may be temporary."); } catch (WorkItemStateChangeException stateChangeException) { MoveItem(mitigation, stateChangeException.FinalStatus, stateChangeException.InitialStatus); ShowWarning?.Invoke($"Mitigation movement failed.\nPlease wait a few moments and retry, because the problem may be temporary."); } finally { _loading = false; } return(result); }