namespace GitHubUpdateNotifier; public sealed class UpdateCheckException : Exception { public string Owner { get; } public string Repository { get; } public IReadOnlyList Failures { get; } internal UpdateCheckException(RepositoryReference repository, IReadOnlyList failures) : base($"No release information could be retrieved for '{repository}'.", BuildInner(failures)) { Owner = repository.Owner; Repository = repository.Name; Failures = failures; } private static Exception? BuildInner(IReadOnlyList failures) => failures.Count switch { 0 => null, 1 => failures[0], _ => new AggregateException(failures), }; }