New test.
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / UnixIOException.cs
index bdf65b1b470894704b9f17e6bdd3a99f6fa616b3..923e7aa08b62436972229546b2e63bfc8e5bb1c8 100644 (file)
@@ -44,39 +44,25 @@ namespace Mono.Unix {
                {}
                
                public UnixIOException (int errno)
-                       : base (UnixMarshal.GetErrorDescription (Native.NativeConvert.ToErrno (errno)))
+                       : base (GetMessage (Native.NativeConvert.ToErrno (errno)))
                {
                        this.errno = errno;
                }
                
                public UnixIOException (int errno, Exception inner)
-                       : base (UnixMarshal.GetErrorDescription (Native.NativeConvert.ToErrno (errno)), inner)
+                       : base (GetMessage (Native.NativeConvert.ToErrno (errno)), inner)
                {
                        this.errno = errno;
                }
 
-               [Obsolete ("Use UnixIOException (Mono.Unix.Native.Errno) constructor")]
-               public UnixIOException (Error errno)
-                       : base (UnixMarshal.GetErrorDescription (errno))
-               {
-                       this.errno = UnixConvert.FromError (errno);
-               }
-
-               [Obsolete ("Use UnixIOException (Mono.Unix.Native.Errno, System.Exception) constructor")]
-               public UnixIOException (Error errno, Exception inner)
-                       : base (UnixMarshal.GetErrorDescription (errno), inner)
-               {
-                       this.errno = UnixConvert.FromError (errno);
-               }
-
                public UnixIOException (Native.Errno errno)
-                       : base (UnixMarshal.GetErrorDescription (errno))
+                       : base (GetMessage (errno))
                {
                        this.errno = Native.NativeConvert.FromErrno (errno);
                }
 
                public UnixIOException (Native.Errno errno, Exception inner)
-                       : base (UnixMarshal.GetErrorDescription (errno), inner)
+                       : base (GetMessage (errno), inner)
                {
                        this.errno = Native.NativeConvert.FromErrno (errno);
                }
@@ -102,10 +88,16 @@ namespace Mono.Unix {
                        get {return errno;}
                }
                
-               [Obsolete ("The type of this property will change in the next release")]
                public Native.Errno ErrorCode {
                        get {return Native.NativeConvert.ToErrno (errno);}
                }
+
+               private static string GetMessage (Native.Errno errno)
+               {
+                       return string.Format ("{0} [{1}].",
+                                       UnixMarshal.GetErrorDescription (errno),
+                                       errno);
+               }
        }
 }