[MediaController] fix bugs (#494)
authorhsgwon <haesu.gwon@samsung.com>
Tue, 2 Oct 2018 04:50:03 +0000 (13:50 +0900)
committerGitHub <noreply@github.com>
Tue, 2 Oct 2018 04:50:03 +0000 (13:50 +0900)
src/Tizen.Multimedia.Remoting/MediaController/MediaControlCommand.cs
src/Tizen.Multimedia.Remoting/MediaController/MediaControlSearchCondition.cs

index 374ba55..91e21bf 100644 (file)
@@ -92,7 +92,6 @@ namespace Tizen.Multimedia.Remoting
         {
             try
             {
-
                 if (bundle != null)
                 {
                     NativeServer.SendCommandReplyBundle(serverHandle, ReceiverId, _requestId, result, bundle.SafeBundleHandle)
@@ -104,6 +103,10 @@ namespace Tizen.Multimedia.Remoting
                         .ThrowIfError("Failed to response command.");
                 }
             }
+            catch (ArgumentException)
+            {
+                throw new InvalidOperationException("Server is not running");
+            }
             finally
             {
                 OnResponseCompleted();
@@ -128,9 +131,13 @@ namespace Tizen.Multimedia.Remoting
                 else
                 {
                     NativeClient.SendCustomEventReply(clientHandle, ReceiverId, _requestId, result, IntPtr.Zero)
-                        .ThrowIfError("Failed to repose event.");
+                        .ThrowIfError("Failed to response event.");
                 }
             }
+            catch (ArgumentException)
+            {
+                throw new InvalidOperationException("Server is not running");
+            }
             finally
             {
                 OnResponseCompleted();
index 8f76392..ba75ec8 100644 (file)
@@ -36,6 +36,10 @@ namespace Tizen.Multimedia.Remoting
         /// <param name="category">The search category.</param>
         /// <param name="keyword">The search keyword.</param>
         /// <param name="bundle">The extra data.</param>
+        /// <exception cref="ArgumentException">
+        /// <paramref name="type"/> or <paramref name="category"/> is not valid.
+        /// </exception>
+        /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
         /// <since_tizen> 5 </since_tizen>
         public MediaControlSearchCondition(MediaControlContentType type, MediaControlSearchCategory category,
             string keyword, Bundle bundle)
@@ -53,6 +57,8 @@ namespace Tizen.Multimedia.Remoting
         /// <param name="type" > The search type.</param>
         /// <param name="keyword">The search keyword.</param>
         /// <param name="bundle">The extra data.</param>
+        /// <exception cref="ArgumentException"><paramref name="type"/> is not valid.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
         /// <since_tizen> 5 </since_tizen>
         public MediaControlSearchCondition(MediaControlContentType type, string keyword, Bundle bundle)
         {