예제 #1
0
        public void CacheDataToFile()
        {
            MyDataReader reader = GetDataReader();

            try
            {
                SaveToFile(reader, "SomeFileName.dat");
                Logger.Write("File saved successfully");
            }
            catch (UserFriendlyException userFriendlyException)
            {
                throw userFriendlyException;
            }
            catch (FileAlreadyExistsException fileAlreadyExistsException)
            {
                this.Logger.Write(fileAlreadyExistsException.InnerException.Message);
            }
            catch (Exception genericException)
            {
                throw new UserFriendlyException("Unable to save data to cache", genericException);
            }
            finally
            {
                reader.Close();
            }
        }
예제 #2
0
 private void SaveToFile(MyDataReader reader, string v)
 {
     throw new NotImplementedException();
 }