winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

UnitSettingConfigRootException.cs (1547B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="UnitSettingConfigRootException.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.Management.Configuration.Processor.Exceptions
      8 {
      9     using System;
     10 
     11     /// <summary>
     12     /// A setting uses the config root variable and the Path was not set in the ConfigurationSet.
     13     /// </summary>
     14     internal class UnitSettingConfigRootException : Exception
     15     {
     16         /// <summary>
     17         /// Initializes a new instance of the <see cref="UnitSettingConfigRootException"/> class.
     18         /// </summary>
     19         /// <param name="unitName">Unit name.</param>
     20         /// <param name="setting">Setting.</param>
     21         public UnitSettingConfigRootException(string unitName, string setting)
     22             : base($"Unit: {unitName} Setting {setting} requires the ConfigurationSet Path")
     23         {
     24             this.HResult = ErrorCodes.WinGetConfigUnitSettingConfigRoot;
     25             this.UnitName = unitName;
     26             this.Setting = setting;
     27         }
     28 
     29         /// <summary>
     30         /// Gets the resource name.
     31         /// </summary>
     32         public string UnitName { get; }
     33 
     34         /// <summary>
     35         /// Gets the setting that reference the config root variable.
     36         /// </summary>
     37         public string Setting { get; }
     38     }
     39 }