Ignore:
Timestamp:
3/1/2010 9:36:02 AM (2 years ago)
Author:
lowjoel
Message:

Define a discrete SharingViolationException? which is thrown when a file is currently in use. This makes handling such errors easier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Util/Win32ErrorCodes.cs

    r1802 r1872  
    3232    { 
    3333        /// <summary> 
     34        /// Gets the error message associated with the provided system error code. 
     35        /// </summary> 
     36        /// <param name="code">The system error code which should have the message queried.</param> 
     37        /// <returns>The string describing the error with the given error code.</returns> 
     38        public static string GetSystemErrorMessage(int code) 
     39        { 
     40            return new System.ComponentModel.Win32Exception(code).Message; 
     41        } 
     42 
     43        /// <summary> 
    3444        /// Converts a Win32 Error code to a HRESULT. 
    3545        /// </summary> 
     
    5363            { 
    5464                case NoError:           return null; 
    55                 case SharingViolation:  return new IOException(); 
     65                case SharingViolation:  return new SharingViolationException(); 
    5666            } 
    5767 
Note: See TracChangeset for help on using the changeset viewer.