From: coderhyme Date: Thu, 21 Sep 2017 02:07:44 +0000 (+0900) Subject: [Multimedia] Modified to throw a exception with better error message when the feature... X-Git-Tag: preview1-00238^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84919aa4ac34e458154b3bf5eaefbf3f4c2352b4;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Multimedia] Modified to throw a exception with better error message when the feature is not supported. Change-Id: Ibac4899819a1cd9c66c53a32d074f720a44d9f6b Signed-off-by: coderhyme --- diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs index 7bb79f7..be0b9a7 100644 --- a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs +++ b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs @@ -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);