[Connection][TCSACR-156] Remove ArgumentException (#325)
authorchleun-moon <32117100+chleun-moon@users.noreply.github.com>
Tue, 10 Jul 2018 04:14:27 +0000 (13:14 +0900)
committertaesubkim <35015408+taesubkim@users.noreply.github.com>
Tue, 10 Jul 2018 04:14:27 +0000 (13:14 +0900)
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs

index 7f3718a..c8cbfa9 100644 (file)
@@ -824,6 +824,10 @@ namespace Tizen.Network.Connection
                     Log.Error(Globals.LogTag, "No connection " + (ConnectionError)ret);
                     return null;
                 }
+                else if ((ConnectionError)ret == ConnectionError.InvalidParameter)
+                {
+                    throw new InvalidOperationException("Invalid handle");
+                }
                 else
                 {
                     Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret);
index 74d4aab..8efa810 100755 (executable)
@@ -281,7 +281,6 @@ namespace Tizen.Network.Connection
         /// <feature>http://tizen.org/feature/network.wifi</feature>
         /// <exception cref="System.NotSupportedException">Thrown when a feature is not supported.</exception>
         /// <exception cref="System.UnauthorizedAccessException">Thrown when a permission is denied.</exception>
-        /// <exception cref="System.ArgumentException">Thrown when a value is an invalid parameter.</exception>
         /// <exception cref="System.InvalidOperationException">Thrown when a profile instance is invalid or when a method fails due to an invalid operation.</exception>
         /// <exception cref="System.ObjectDisposedException">Thrown when an operation is performed on a disposed object.</exception>
         public void Refresh()
@@ -291,6 +290,10 @@ namespace Tizen.Network.Connection
             if ((ConnectionError)ret != ConnectionError.None)
             {
                 Log.Error(Globals.LogTag, "It failed to get network interface name, " + (ConnectionError)ret);
+                if ((ConnectionError)ret == ConnectionError.InvalidParameter)
+                {
+                    throw new InvalidOperationException("Invalid handle");
+                }
                 ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
                 ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
                 ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released");
index a0d1ae6..a61b801 100755 (executable)
@@ -188,7 +188,6 @@ namespace Tizen.Network.Connection
         /// <feature>http://tizen.org/feature/network.ethernet</feature>
         /// <exception cref="System.NotSupportedException">Thrown when a feature is not supported.</exception>
         /// <exception cref="System.UnauthorizedAccessException">Thrown when a permission is denied.</exception>
-        /// <exception cref="System.ArgumentException">Thrown when a value is an invalid parameter.</exception>
         /// <exception cref="System.OutOfMemoryException">Thrown when memory is not enough to continue execution.</exception>
         /// <exception cref="System.InvalidOperationException">Thrown when a connection instance is invalid or when a method fails due to an invalid operation.</exception>
         public static ConnectionProfile GetCurrentProfile()