protected override void ProcessRecord()

in src/PowerShell/Commands/ResolvePartnerError.cs [30:56]


        protected override void ProcessRecord()
        {
            IEnumerable<ErrorRecord> records = null;

            if (ParameterSetName.Equals(LastErrorParameterSet, StringComparison.InvariantCultureIgnoreCase))
            {
                IEnumerable<ErrorRecord> errors = GetErrorVariable();

                if (errors != null && errors.FirstOrDefault() != null)
                {
                    records = new List<ErrorRecord> { { errors.FirstOrDefault() } };
                }
            }
            else
            {
                records = Error ?? GetErrorVariable();
            }


            if (records != null)
            {
                foreach (ErrorRecord record in records)
                {
                    HandleException(record.Exception, record);
                }
            }
        }