From 3b5e1eb6c68da0fc775439d19521f3d10f42f271 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Fri, 12 May 2017 14:23:11 +0900 Subject: [PATCH] Fix exceptions and descriptions Change-Id: I9a5d69fe5f55ed611bdca97b12f6ce7228501257 Signed-off-by: sooyeon.kim --- .../Tizen.Uix.VoiceControl/ExceptionFactory.cs | 10 +- .../Tizen.Uix.VoiceControl/VoiceCommand.cs | 36 +++---- .../Tizen.Uix.VoiceControl/VoiceCommandList.cs | 66 +++++------- .../Tizen.Uix.VoiceControl/VoiceControlClient.cs | 116 ++++++++------------- 4 files changed, 83 insertions(+), 145 deletions(-) diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs index a4d57a9..8c6e35f 100755 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs +++ b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs @@ -29,7 +29,7 @@ namespace Tizen.Uix.VoiceControl { case ErrorCode.OutOfMemory: { - exp = new InvalidOperationException("Out Of Memory"); + exp = new OutOfMemoryException("Out Of Memory"); break; } @@ -41,13 +41,13 @@ namespace Tizen.Uix.VoiceControl case ErrorCode.InvalidParameter: { - exp = new InvalidOperationException("Invalid Parameters Provided"); + exp = new ArgumentException("Invalid Parameters Provided"); break; } case ErrorCode.TimedOut: { - exp = new InvalidOperationException("No answer from service"); + exp = new TimeoutException("No answer from service"); break; } @@ -59,13 +59,13 @@ namespace Tizen.Uix.VoiceControl case ErrorCode.PermissionDenied: { - exp = new InvalidOperationException("Permission Denied"); + exp = new UnauthorizedAccessException("Permission Denied"); break; } case ErrorCode.NotSupported: { - exp = new InvalidOperationException("VC NOT supported"); + exp = new NotSupportedException("VC NOT supported"); break; } diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs index d750ee6..b27b785 100755 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs +++ b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs @@ -61,12 +61,9 @@ namespace Tizen.Uix.VoiceControl /// /// Public Constructor /// - /// - /// This Exception can be due to the following reaons - /// 1. Out of memory - /// 2. Permission Denied - /// 3. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Out Of Memory. + /// This Exception can be due to Permission Denied. public VoiceCommand() { SafeCommandHandle handle; @@ -109,12 +106,9 @@ namespace Tizen.Uix.VoiceControl /// Gets/Sets command type. /// /// If you do not set the command type, the default value is Undefined. You should set type if command is valid - /// - /// This Exception can be due to the following reaons for set operation - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public CommandType Type { get @@ -149,12 +143,9 @@ namespace Tizen.Uix.VoiceControl /// Gets/Sets the command format. /// /// The default format is Fixed - /// - /// This Exception can be due to the following reaons for set operation - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public CommandFormat Format { get @@ -183,12 +174,9 @@ namespace Tizen.Uix.VoiceControl /// Gets/Sets command /// in case of get empty string will be returned in case of some internal error /// - /// - /// This Exception can be due to the following reaons for set operation - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public string Command { get diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs index a6635ed..535c897 100755 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs +++ b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs @@ -43,13 +43,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// 4. Out of memory - /// + /// This Exception can be due to Out of memory. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public VoiceCommandList() { SafeCommandListHandle handle = new SafeCommandListHandle(); @@ -139,13 +136,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/microphone /// /// The command - /// - /// This Exception can be due to the following reaons - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// - /// This will occur if the provide parameter is null + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. + /// This will occur if the provide parameter is null. public void Add(VoiceCommand command) { ErrorCode error = VcCmdListAdd(_handle, command._handle); @@ -170,13 +164,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/microphone /// /// The command - /// - /// This Exception can be due to the following reaons - /// 1. Invalid parameter - /// 2. Permission Denied - /// 3. Not supported - /// - /// This will occur if the provide parameter is null + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. + /// This will occur if the provide parameter is null. public void Remove(VoiceCommand command) { ErrorCode error = VcCmdListRemove(_handle, command._handle); @@ -200,11 +191,8 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Permission Denied - /// 2. Not supported - /// + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public IEnumerable GetAllCommands() { _list = new List(); @@ -238,12 +226,9 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. List Empty - /// 2. Permission Denied - /// 3. Not supported - /// + /// This Exception can be due to List Empty. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public void First() { ErrorCode error = VcCmdListFirst(_handle); @@ -267,12 +252,9 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. List Empty - /// 2. Permission Denied - /// 3. Not supported - /// + /// This Exception can be due to List Empty. + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public void Last() { ErrorCode error = VcCmdListLast(_handle); @@ -300,9 +282,9 @@ namespace Tizen.Uix.VoiceControl /// This Exception can be due to the following reaons /// 1. List Empty /// 2. List reached end - /// 3. Permission Denied - /// 4. Not supported /// + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public void Next() { ErrorCode error = VcCmdListNext(_handle); @@ -330,9 +312,9 @@ namespace Tizen.Uix.VoiceControl /// This Exception can be due to the following reaons /// 1. List Empty /// 2. List reached end - /// 3. Permission Denied - /// 4. Not supported /// + /// This Exception can be due to Permission Denied. + /// This Exception can be due to Not Supported. public void Previous() { ErrorCode error = VcCmdListPrev(_handle); diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs index 137df48..85f6b36 100755 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs +++ b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs @@ -334,13 +334,10 @@ namespace Tizen.Uix.VoiceControl /// This function should be called before SetCommandList(). /// /// Invocation name that an application wants to be invoked by - /// - /// This Exception can be due to the following reaons - /// 1. Invalid parameter - /// 2. Invalid state - /// 3. Not Supported - /// 4. Permission Denied - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State must be Ready. /// @@ -367,13 +364,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Out Of Memory - /// 2. Operation Failed - /// 3. Not Supported - /// 4. Permission Denied - /// + /// This Exception can be due to Operation Failed. + /// This Exception can be due to Out Of Memory. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State will be Initialized. /// @@ -400,13 +394,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Operation Failed - /// 2. Invalid state - /// 3. Not Supported - /// 4. Permission Denied - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Operation Failed. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. public static void Deinitialize() { ErrorCode error = VcDeinitialize(); @@ -430,13 +421,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Operation Failed - /// 2. Not Supported - /// 3. Permission Denied - /// 4. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Operation Failed. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Initialized /// @@ -466,12 +454,9 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Permission Denied - /// 3. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready /// @@ -504,13 +489,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/speech.control /// http://tizen.org/feature/microphone /// - /// - /// This Exception can be due to the following reaons - /// 1. Operation Failed - /// 2. Not Supported - /// 3. Permission Denied - /// 4. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Operation Failed. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready or Initialized /// @@ -553,12 +535,10 @@ namespace Tizen.Uix.VoiceControl /// In the system command list, there are system commands predefined by product manufacturers. /// Those commands have the highest priority. Therefore, the user can not set any commands same with the system commands. /// - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Permission Denied - /// 3. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Operation Failed. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready /// @@ -606,13 +586,10 @@ namespace Tizen.Uix.VoiceControl /// Text to be displayed on the screen/// /// Text to be spoken /// A variable for setting whether the dialog session will be restarted automatically or not - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Permission Denied - /// 3. Invalid State - /// 4. Invalid parameter - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready /// @@ -645,13 +622,10 @@ namespace Tizen.Uix.VoiceControl /// /// Command list /// Command type - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Permission Denied - /// 3. Invalid State - /// 4. Invalid parameter - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready /// @@ -687,13 +661,10 @@ namespace Tizen.Uix.VoiceControl /// http://tizen.org/feature/microphone /// /// Command type - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Permission Denied - /// 3. Invalid State - /// 4. Invalid parameter - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Not Supported. + /// This Exception can be due to Permission Denied. /// /// The State should be Ready /// @@ -734,12 +705,9 @@ namespace Tizen.Uix.VoiceControl /// /// Callback function to get recognition result /// - /// - /// This Exception can be due to the following reaons - /// 1. Not Supported - /// 2. Invalid State - /// 3. Invalid parameter - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to Invalid Parameter. + /// This Exception can be due to Not Supported. /// /// The State should be Ready /// -- 2.7.4