Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="info">The serialization info.</param>
 /// <param name="context">The streaming context.</param>
 private Nfs3Exception(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _status = (Nfs3Status)info.GetInt32("Status");
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="status">The status result of an NFS procedure.</param>
 public Nfs3Exception(string message, Nfs3Status status)
     : base(message)
 {
     _status = status;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="status">The status result of an NFS procedure.</param>
 internal Nfs3Exception(Nfs3Status status)
     : base(GenerateMessage(status))
 {
     _status = status;
 }
Exemple #4
0
 private static string GenerateMessage(Nfs3Status status)
 {
     switch (status)
     {
         case Nfs3Status.Ok:
             return "OK";
         case Nfs3Status.NotOwner:
             return "Not owner";
         case Nfs3Status.NoSuchEntity:
             return "No such file or directory";
         case Nfs3Status.IOError:
             return "Hardware I/O error";
         case Nfs3Status.NoSuchDeviceOrAddress:
             return "I/O error - no such device or address";
         case Nfs3Status.AccessDenied:
             return "Permission denied";
         case Nfs3Status.FileExists:
             return "File exists";
         case Nfs3Status.AttemptedCrossDeviceHardLink:
             return "Attempted cross-device hard link";
         case Nfs3Status.NoSuchDevice:
             return "No such device";
         case Nfs3Status.NotDirectory:
             return "Not a directory";
         case Nfs3Status.IsADirectory:
             return "Is a directory";
         case Nfs3Status.InvalidArgument:
             return "Invalid or unsupported argument";
         case Nfs3Status.FileTooLarge:
             return "File too large";
         case Nfs3Status.NoSpaceAvailable:
             return "No space left on device";
         case Nfs3Status.ReadOnlyFileSystem:
             return "Read-only file system";
         case Nfs3Status.TooManyHardLinks:
             return "Too many hard links";
         case Nfs3Status.NameTooLong:
             return "Name too long";
         case Nfs3Status.DirectoryNotEmpty:
             return "Directory not empty";
         case Nfs3Status.QuotaHardLimitExceeded:
             return "Quota hard limit exceeded";
         case Nfs3Status.StaleFileHandle:
             return "Invalid (stale) file handle";
         case Nfs3Status.TooManyRemoteAccessLevels:
             return "Too many levels of remote access";
         case Nfs3Status.BadFileHandle:
             return "Illegal NFS file handle";
         case Nfs3Status.UpdateSynchronizationError:
             return "Update synchronization error";
         case Nfs3Status.StaleCookie:
             return "Read directory cookie stale";
         case Nfs3Status.NotSupported:
             return "Operation is not supported";
         case Nfs3Status.TooSmall:
             return "Buffer or request is too small";
         case Nfs3Status.ServerFault:
             return "Server fault";
         case Nfs3Status.BadType:
             return "Server doesn't support object type";
         case Nfs3Status.SlowJukebox:
             return "Unable to complete in timely fashion";
         default:
             return "Unknown error: " + status;
     }
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="info">The serialization info</param>
 /// <param name="context">The streaming context</param>
 private Nfs3Exception(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _status = (Nfs3Status)info.GetInt32("Status");
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="status">The status result of an NFS procedure.</param>
 internal Nfs3Exception(Nfs3Status status)
     : base(GenerateMessage(status))
 {
     _status = status;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the Nfs3Exception class.
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="status">The status result of an NFS procedure.</param>
 public Nfs3Exception(string message, Nfs3Status status)
     : base(message)
 {
     _status = status;
 }
Exemple #8
0
        private static string GenerateMessage(Nfs3Status status)
        {
            switch (status)
            {
            case Nfs3Status.Ok:
                return("OK");

            case Nfs3Status.NotOwner:
                return("Not owner");

            case Nfs3Status.NoSuchEntity:
                return("No such file or directory");

            case Nfs3Status.IOError:
                return("Hardware I/O error");

            case Nfs3Status.NoSuchDeviceOrAddress:
                return("I/O error - no such device or address");

            case Nfs3Status.AccessDenied:
                return("Permission denied");

            case Nfs3Status.FileExists:
                return("File exists");

            case Nfs3Status.AttemptedCrossDeviceHardLink:
                return("Attempted cross-device hard link");

            case Nfs3Status.NoSuchDevice:
                return("No such device");

            case Nfs3Status.NotDirectory:
                return("Not a directory");

            case Nfs3Status.IsADirectory:
                return("Is a directory");

            case Nfs3Status.InvalidArgument:
                return("Invalid or unsupported argument");

            case Nfs3Status.FileTooLarge:
                return("File too large");

            case Nfs3Status.NoSpaceAvailable:
                return("No space left on device");

            case Nfs3Status.ReadOnlyFileSystem:
                return("Read-only file system");

            case Nfs3Status.TooManyHardLinks:
                return("Too many hard links");

            case Nfs3Status.NameTooLong:
                return("Name too long");

            case Nfs3Status.DirectoryNotEmpty:
                return("Directory not empty");

            case Nfs3Status.QuotaHardLimitExceeded:
                return("Quota hard limit exceeded");

            case Nfs3Status.StaleFileHandle:
                return("Invalid (stale) file handle");

            case Nfs3Status.TooManyRemoteAccessLevels:
                return("Too many levels of remote access");

            case Nfs3Status.BadFileHandle:
                return("Illegal NFS file handle");

            case Nfs3Status.UpdateSynchronizationError:
                return("Update synchronization error");

            case Nfs3Status.StaleCookie:
                return("Read directory cookie stale");

            case Nfs3Status.NotSupported:
                return("Operation is not supported");

            case Nfs3Status.TooSmall:
                return("Buffer or request is too small");

            case Nfs3Status.ServerFault:
                return("Server fault");

            case Nfs3Status.BadType:
                return("Server doesn't support object type");

            case Nfs3Status.SlowJukebox:
                return("Unable to complete in timely fashion");

            default:
                return("Unknown error: " + status);
            }
        }