コード例 #1
0
        /// <summary>
        /// Report the failure to import a record.
        /// </summary>
        /// <param name="objectReader">The record that failed.</param>
        /// <param name="message">The cause of failure.</param>
        public void ReportError(IObjectReader objectReader, string message)
        {
            // Strip off any API connector platform error codes
            string errorMessage = Messages.GetErrorText(message);

            string location = objectReader.GetLocation( );

            if (location != null)
            {
                errorMessage = string.Concat(location, ": ", errorMessage);
            }

            if (_failReasons == null)
            {
                _failReasons = new List <string>( );
            }
            if (_message == null)
            {
                _message = new StringBuilder(_importRun.ImportMessages);
            }

            if (!_readersWithErrors.Contains(objectReader))
            {
                _readersWithErrors.Add(objectReader);
                _recordsFailed++;
            }

            _failReasons.Add(errorMessage);
            _messageChanged = true;
        }
コード例 #2
0
 /// <summary>
 /// Get some sort of reference of where the object came from.
 /// </summary>
 /// <returns>The location.</returns>
 public string GetLocation( )
 {
     return(_inner.GetLocation( ));
 }