Пример #1
0
        /// <summary>
        /// Constructs a ProviderInvocationException with provider information and an
        /// ErrorRecord.
        /// </summary>
        /// <param name="provider">
        /// Information about the provider to be used in formatting the message.
        /// </param>
        /// <param name="errorRecord">
        /// Detailed error information
        /// </param>
        internal ProviderInvocationException(ProviderInfo provider, ErrorRecord errorRecord)
            : base(RuntimeException.RetrieveMessage(errorRecord),
                   RuntimeException.RetrieveException(errorRecord))
        {
            if (errorRecord == null)
            {
                throw new ArgumentNullException(nameof(errorRecord));
            }

            _message      = base.Message;
            _providerInfo = provider;
            _errorRecord  = errorRecord;
        }
Пример #2
0
 internal CmdletInvocationException(ErrorRecord errorRecord)
     : base(RuntimeException.RetrieveMessage(errorRecord), RuntimeException.RetrieveException(errorRecord))
 {
     this._errorRecord = errorRecord != null ? errorRecord : throw new ArgumentNullException(nameof(errorRecord));
     Exception exception = errorRecord.Exception;
 }
Пример #3
0
 internal ProviderInvocationException(System.Management.Automation.ProviderInfo provider, System.Management.Automation.ErrorRecord errorRecord) : base(RuntimeException.RetrieveMessage(errorRecord), RuntimeException.RetrieveException(errorRecord))
 {
     if (errorRecord == null)
     {
         throw new ArgumentNullException("errorRecord");
     }
     this._message      = base.Message;
     this._providerInfo = provider;
     this._errorRecord  = errorRecord;
 }
Пример #4
0
 internal CmdletInvocationException(System.Management.Automation.ErrorRecord errorRecord) : base(RuntimeException.RetrieveMessage(errorRecord), RuntimeException.RetrieveException(errorRecord))
 {
     if (errorRecord == null)
     {
         throw new ArgumentNullException("errorRecord");
     }
     this._errorRecord = errorRecord;
     Exception exception = errorRecord.Exception;
 }