[Multimedia] Modified to throw a exception with better error message when the feature... 37/151437/1
authorcoderhyme <jhyo.kim@samsung.com>
Thu, 21 Sep 2017 02:07:44 +0000 (11:07 +0900)
committercoderhyme <jhyo.kim@samsung.com>
Thu, 21 Sep 2017 02:07:44 +0000 (11:07 +0900)
Change-Id: Ibac4899819a1cd9c66c53a32d074f720a44d9f6b
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs

index 7bb79f7..be0b9a7 100644 (file)
@@ -68,7 +68,15 @@ namespace Tizen.Multimedia
 
         private static Capabilities LoadCapabilities()
         {
-            Native.Create(out var handle).ThrowIfError("Failed to load the capabilities"); ;
+            var ret = Native.Create(out var handle);
+
+            if (ret == RecorderErrorCode.NotSupported)
+            {
+                throw new NotSupportedException("Audio recording is not supported.");
+            }
+
+            ret.ThrowIfError("Failed to load the capabilities");
+
             using (handle)
             {
                 return new Capabilities(handle);