FindPackagesException.cs (1381B)
1 // ----------------------------------------------------------------------------- 2 // <copyright file="FindPackagesException.cs" company="Microsoft Corporation"> 3 // Copyright (c) Microsoft Corporation. Licensed under the MIT License. 4 // </copyright> 5 // ----------------------------------------------------------------------------- 6 7 namespace Microsoft.WinGet.Client.Engine.Exceptions 8 { 9 using System; 10 using System.Management.Automation; 11 using Microsoft.Management.Deployment; 12 using Microsoft.WinGet.Resources; 13 14 /// <summary> 15 /// Raised when there is an error searching for packages. 16 /// </summary> 17 [Serializable] 18 internal class FindPackagesException : RuntimeException 19 { 20 /// <summary> 21 /// Initializes a new instance of the <see cref="FindPackagesException"/> class. 22 /// </summary> 23 /// <param name="status">A <see cref="FindPackagesResultStatus" /> value.</param> 24 public FindPackagesException(FindPackagesResultStatus status) 25 : base(string.Format( 26 Resources.FindPackagesExceptionMessage, 27 status.ToString())) 28 { 29 this.Status = status; 30 } 31 32 /// <summary> 33 /// Gets the error status. 34 /// </summary> 35 public FindPackagesResultStatus Status { get; private set; } 36 } 37 }