Ignore:
Timestamp:
2/8/2010 7:09:55 AM (2 years ago)
Author:
lowjoel
Message:

Do not localise exceptions which aren't meant to be seen by the user. User-visible exceptions will be dealt with in a separate ticket. Do not throw exceptions to indicate handleable errors (notably, when erasing unused space without administrator permissions) Addresses #275: Code Review

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.Manager/DirectExecutor.cs

    r1765 r1767  
    263263                                    EraseFilesystemObject(task, fileSystemObjectTarget); 
    264264                                else 
    265                                     throw new ArgumentException(S._("Unknown erasure target.")); 
     265                                    throw new ArgumentException("Unknown erasure target."); 
    266266                            } 
    267267                            catch (FatalException) 
     
    341341                    Environment.OSVersion.Version >= new Version(6, 0)) 
    342342                { 
    343                     throw new UnauthorizedAccessException(S._("The program does not have the " + 
    344                         "required permissions to erase the unused space on disk. Run the program " + 
    345                         "as an administrator and retry the operation.")); 
     343                    task.Log.LastSessionEntries.Add(new LogEntry(S._("The program does not have " + 
     344                        "the required permissions to erase the unused space on disk. Run the " + 
     345                        "program as an administrator and retry the operation."), LogLevel.Error)); 
    346346                } 
    347347                else 
    348                     throw new UnauthorizedAccessException(S._("The program does not have the " + 
    349                         "required permissions to erase the unused space on disk.")); 
     348                { 
     349                    task.Log.LastSessionEntries.Add(new LogEntry(S._("The program does not have " + 
     350                        "the required permissions to erase the unused space on disk"), 
     351                        LogLevel.Error)); 
     352                } 
    350353            } 
    351354 
Note: See TracChangeset for help on using the changeset viewer.