/// <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; }
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; }
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; }
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; }