From: chleun-moon <32117100+chleun-moon@users.noreply.github.com> Date: Wed, 11 Jul 2018 23:42:40 +0000 (+0900) Subject: [WiFi][TCSACR-155] Remove ArgumentException descriptions (#323) X-Git-Tag: 5.0.0.14562~157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4bea4951f08e7ec6aea93671bdfdf8723c49028;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [WiFi][TCSACR-155] Remove ArgumentException descriptions (#323) * [WiFi][TCSACR-155] Remove RgumentException descriptions * [WiFi] Fix mistakes * [WiFi] Fix the location to check InvalidParameterError --- diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs index 11d37d3..72ecd2b 100644 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs @@ -186,7 +186,6 @@ namespace Tizen.Network.WiFi /// Thrown when the Wi-Fi is not supported. /// Thrown when permission is denied. /// Thrown when the object instance is disposed or released. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public void Refresh() { @@ -199,6 +198,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to refresh ap handle, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _apHandle, "http://tizen.org/privilege/network.get"); } } @@ -218,7 +221,6 @@ namespace Tizen.Network.WiFi /// Thrown when permission is denied. /// Thrown when the object instance is disposed or released. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public Task ConnectAsync() { @@ -260,6 +262,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to connect wifi, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); } } @@ -526,7 +532,6 @@ namespace Tizen.Network.WiFi /// Thrown when permission is denied. /// Thrown when the object instance is disposed or released. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public Task DisconnectAsync() { @@ -568,6 +573,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to disconnect wifi, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); } } @@ -593,7 +602,6 @@ namespace Tizen.Network.WiFi /// Thrown when permission is denied. /// Thrown when the object instance is disposed or released. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public void ForgetAP() { @@ -606,6 +614,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to forget AP, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); } } diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs index ace465d..ef89fc0 100755 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs @@ -190,7 +190,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/feature/network.wifi /// Thrown when the Wi-Fi is not supported. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due an to invalid operation. public string GetClientCertFile() { @@ -199,6 +198,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); } return Marshal.PtrToStringAnsi(strPtr); @@ -236,7 +239,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/feature/network.wifi /// Thrown when the Wi-Fi is not supported. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public string GetUserName() { @@ -246,6 +248,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get user name in eap passphrase, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); } return Marshal.PtrToStringAnsi(strptr); @@ -259,7 +265,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/feature/network.wifi /// Thrown when the Wi-Fi is not supported. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public bool IsPasswordSet() { @@ -269,6 +274,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get IsPasswordSet in passphrase, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); } return passwordSet; diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs index 0add948..acb5540 100755 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs @@ -229,7 +229,6 @@ namespace Tizen.Network.WiFi /// The certification authority (CA) certificates file of the access point. /// http://tizen.org/feature/network.wifi /// Thrown when the Wi-Fi is not supported. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public string GetClientCertFile() { @@ -238,6 +237,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); } return Marshal.PtrToStringAnsi(strPtr); diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs index 532c433..21cc55a 100755 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs @@ -211,7 +211,6 @@ namespace Tizen.Network.WiFi /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. [EditorBrowsable(EditorBrowsableState.Never)] public static SafeWiFiManagerHandle GetWiFiHandle() @@ -228,7 +227,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public IEnumerable GetFoundAPs() { @@ -244,7 +242,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public IEnumerable GetFoundSpecificAPs() { @@ -276,7 +273,6 @@ namespace Tizen.Network.WiFi /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. /// Thrown when system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public IEnumerable GetWiFiConfigurations() { @@ -310,7 +306,6 @@ namespace Tizen.Network.WiFi /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. /// Thrown when system is out of memory. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public WiFiAP GetConnectedAP() { @@ -327,7 +322,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public Task ActivateAsync() { @@ -344,7 +338,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public Task ActivateWithPickerAsync() { @@ -361,7 +354,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public Task DeactivateAsync() { @@ -378,7 +370,6 @@ namespace Tizen.Network.WiFi /// http://tizen.org/privilege/network.get /// Thrown when the Wi-Fi is not supported. /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. static public Task ScanAsync() { diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs index b4b23ac..03fceb7 100644 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs @@ -184,6 +184,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get all APs, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); } @@ -212,6 +216,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get specific APs, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); } @@ -239,6 +247,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get bssid APs, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); } @@ -266,6 +278,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get configurations, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.profile"); } @@ -301,6 +317,10 @@ namespace Tizen.Network.WiFi Log.Error(Globals.LogTag, "No connection " + (WiFiError)ret); return null; } + else if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } else { Log.Error(Globals.LogTag, "Failed to get connected AP, Error - " + (WiFiError)ret); @@ -347,6 +367,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); } } @@ -396,6 +420,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); } } @@ -445,6 +473,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to deactivate wifi, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); } } @@ -494,6 +526,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to scan all AP, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); } } @@ -592,6 +628,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to scan Bssid AP, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); } } diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs index bef2729..f801966 100755 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs @@ -377,7 +377,6 @@ namespace Tizen.Network.WiFi /// A list of IPv6 addresses of the access point. /// http://tizen.org/feature/network.wifi /// Thrown when the Wi-Fi is not supported. - /// Thrown when the method failed due to an invalid parameter. /// Thrown when the method failed due to an invalid operation. public IEnumerable GetAllIPv6Addresses() { @@ -401,6 +400,10 @@ namespace Tizen.Network.WiFi if (ret != (int)WiFiError.None) { Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (WiFiError)ret); + if (ret == (int)WiFiError.InvalidParameterError) + { + throw new InvalidOperationException("Invalid handle"); + } WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); } @@ -432,11 +435,11 @@ namespace Tizen.Network.WiFi int ret = Interop.WiFi.AP.GetBssids(_apHandle, callback, IntPtr.Zero); if (ret != (int)WiFiError.None) { + Log.Error(Globals.LogTag, "Failed to get BSSIDs, Error - " + (WiFiError)ret); if (ret == (int)WiFiError.InvalidParameterError) { throw new InvalidOperationException("Invalid handle"); } - Log.Error(Globals.LogTag, "Failed to get BSSIDs, Error - " + (WiFiError)ret); WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); }