private void HandleReaderException(Exception e)
 {
     if (!e.IsCatchableEntityExceptionType())
     {
         return;
     }
     if (this.Reader.IsClosed)
     {
         throw new EntityCommandExecutionException(Strings.ADP_DataReaderClosed((object)"Read"), e);
     }
     throw new EntityCommandExecutionException(Strings.EntityClient_StoreReaderFailed, e);
 }
        private void HandleReaderException(Exception e)
        {
            // wrap exception if necessary
            if (e.IsCatchableEntityExceptionType())
            {
                // check if the reader is closed; if so, throw friendlier exception
                if (Reader.IsClosed)
                {
                    throw new EntityCommandExecutionException((Strings.ADP_DataReaderClosed("Read")), e);
                }

                throw new EntityCommandExecutionException(Strings.EntityClient_StoreReaderFailed, e);
            }
        }
Beispiel #3
0
 /// <summary>
 ///     Ensures that the reader is actually open, and throws an exception if not
 /// </summary>
 private void AssertReaderIsOpen(string methodName)
 {
     if (IsClosed)
     {
         if (_dataRecord.IsImplicitlyClosed)
         {
             throw new InvalidOperationException(Strings.ADP_ImplicitlyClosedDataReaderError);
         }
         if (_dataRecord.IsExplicitlyClosed)
         {
             throw new InvalidOperationException(Strings.ADP_DataReaderClosed(methodName));
         }
     }
 }
Beispiel #4
0
        private bool HandleReaderException(Exception e)
        {
            // check if the reader is closed; if so, throw friendlier exception
            if (Reader.IsClosed)
            {
                const string operation = "Read";
                throw new InvalidOperationException(Strings.ADP_DataReaderClosed(operation));
            }

            // wrap exception if necessary
            if (e.IsCatchableEntityExceptionType())
            {
                throw new EntityCommandExecutionException(Strings.EntityClient_StoreReaderFailed, e);
            }

            return(false);
        }
Beispiel #5
0
 internal static Exception ADP_DataReaderClosed(object p0)
 {
     return((Exception) new InvalidOperationException(Strings.ADP_DataReaderClosed(p0)));
 }