From 84919aa4ac34e458154b3bf5eaefbf3f4c2352b4 Mon Sep 17 00:00:00 2001 From: coderhyme Date: Thu, 21 Sep 2017 11:07:44 +0900 Subject: [PATCH] [Multimedia] Modified to throw a exception with better error message when the feature is not supported. Change-Id: Ibac4899819a1cd9c66c53a32d074f720a44d9f6b Signed-off-by: coderhyme --- .../Recorder/Recorder.Capabilities.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs index 7bb79f744..be0b9a7b5 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); -- 2.34.1