public GetBuildsStatuses ( SirenOfShame.Lib.Settings.CiEntryPointSetting ciEntryPointSetting, |
||
ciEntryPointSetting | SirenOfShame.Lib.Settings.CiEntryPointSetting | |
watchedBuildDefinitions | ||
return | Task |
protected override IList <BuildStatus> GetBuildStatus() { var watchedBuildDefinitions = GetAllWatchedBuildDefinitions().ToArray(); if (string.IsNullOrEmpty(CiEntryPointSetting.Url)) { throw new SosException("TFS URL is null or empty"); } try { return(_service.GetBuildsStatuses(CiEntryPointSetting, watchedBuildDefinitions).Result .Cast <BuildStatus>().ToList()); } catch (WebException ex) { if ( ex.Message.StartsWith("The remote name could not be resolved:") || ex.Message.Contains("Unable to connect to the remote server") ) { throw new ServerUnavailableException(); } throw; } }
protected override IList <BuildStatus> GetBuildStatus() { var watchedBuildDefinitions = GetAllWatchedBuildDefinitions().ToArray(); if (string.IsNullOrEmpty(CiEntryPointSetting.Url)) { throw new SosException("TFS URL is null or empty"); } try { return(_service.GetBuildsStatuses(CiEntryPointSetting, watchedBuildDefinitions).Result .Cast <BuildStatus>().ToList()); } catch (AggregateException ex) { var anyInvalidCredentials = ex.InnerExceptions.Any(IsInvalidCredentials); if (anyInvalidCredentials) { throw new InvalidCredentialsException(); } var anyServerUnavailable = ex.InnerExceptions.Any(IsServerUnavailable); if (anyServerUnavailable) { throw new ServerUnavailableException(); } throw; } catch (WebException ex) { var isServerUnavailable = IsServerUnavailable(ex); if (isServerUnavailable) { throw new ServerUnavailableException(); } throw; } }
protected override IList <BuildStatus> GetBuildStatus() { var watchedBuildDefinitions = GetAllWatchedBuildDefinitions().ToArray(); if (string.IsNullOrEmpty(CiEntryPointSetting.Url)) { throw new SosException("TFS URL is null or empty"); } try { return(_service.GetBuildsStatuses(CiEntryPointSetting, watchedBuildDefinitions).Result .Cast <BuildStatus>().ToList()); } catch (AggregateException ex) { var anyServerUnavailable = ex.InnerExceptions.Any(IsServerUnavailable); if (anyServerUnavailable) { throw new ServerUnavailableException(); } var taskCancelledException = ex.InnerExceptions.FirstOrDefault(x => x is TaskCanceledException); if (!ReferenceEquals(null, taskCancelledException)) { throw taskCancelledException; } throw; } catch (WebException ex) { var isServerUnavailable = IsServerUnavailable(ex); if (isServerUnavailable) { throw new ServerUnavailableException(); } throw; } }