From ae044333be7f802b11a4470aee05df717d985f40 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Tue, 3 Jan 2017 19:11:52 +0900 Subject: [PATCH] [Camera/Recorder] Modify exception class Change-Id: I31791a4368303aec5247dc6db9da81db207d70ff Signed-off-by: Haesu Gwon --- packaging/csapi-multimedia.spec | 2 +- src/Tizen.Multimedia/Camera/CameraErrorFactory.cs | 4 +++ .../Recorder/RecorderErrorFactory.cs | 42 +++++++++++++--------- 3 files changed, 30 insertions(+), 18 deletions(-) mode change 100644 => 100755 src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs diff --git a/packaging/csapi-multimedia.spec b/packaging/csapi-multimedia.spec index 4a03c0b..c383e3c 100644 --- a/packaging/csapi-multimedia.spec +++ b/packaging/csapi-multimedia.spec @@ -1,6 +1,6 @@ Name: csapi-multimedia Summary: Tizen Multimedia API for C# -Version: 1.0.27 +Version: 1.0.28 Release: 0 Group: Development/Libraries License: Apache-2.0 diff --git a/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs b/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs index 2888e67..fd7c6a6 100755 --- a/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs +++ b/src/Tizen.Multimedia/Camera/CameraErrorFactory.cs @@ -58,6 +58,8 @@ namespace Tizen.Multimedia throw new ArgumentException(errorMessage, paramName); case CameraError.OutOfMemory: + throw new OutOfMemoryException(errorMessage); + case CameraError.ErrorDevice: case CameraError.DeviceBusy: case CameraError.DeviceNotFound: @@ -68,8 +70,10 @@ namespace Tizen.Multimedia case CameraError.Esd: case CameraError.PermissionDenied: throw new UnauthorizedAccessException(errorMessage); + case CameraError.NotSupported: throw new NotSupportedException(errorMessage); + case CameraError.InvalidState: case CameraError.InvalidOperation: case CameraError.ResourceConflict: diff --git a/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs b/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs old mode 100644 new mode 100755 index de84954..e497d4d --- a/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs +++ b/src/Tizen.Multimedia/Recorder/RecorderErrorFactory.cs @@ -48,24 +48,32 @@ namespace Tizen.Multimedia if(string.IsNullOrEmpty(errorMessage)) { errorMessage = err.ToString(); } - switch((RecorderError)errorCode) { - case RecorderError.InvalidParameter: - throw new ArgumentException(errorMessage, paramName); - case RecorderError.InvalidState: - case RecorderError.OutOfMemory: - case RecorderError.ErrorDevice: - case RecorderError.InvalidOperation: - case RecorderError.SoundPolicy: - case RecorderError.SecurityRestricted: - case RecorderError.SoundPolicyByCall: - case RecorderError.SoundPolicyByAlarm: - case RecorderError.Esd: - case RecorderError.OutOfStorage: - case RecorderError.PermissionDenied: - case RecorderError.NotSupported: - case RecorderError.ResourceConflict: - throw new InvalidOperationException(errorMessage); + switch((RecorderError)errorCode) + { + case RecorderError.InvalidParameter: + throw new ArgumentException(errorMessage, paramName); + + case RecorderError.OutOfMemory: + throw new OutOfMemoryException(errorMessage); + + case RecorderError.ErrorDevice: + case RecorderError.SoundPolicy: + case RecorderError.SecurityRestricted: + case RecorderError.SoundPolicyByCall: + case RecorderError.SoundPolicyByAlarm: + case RecorderError.Esd: + case RecorderError.OutOfStorage: + case RecorderError.PermissionDenied: + throw new UnauthorizedAccessException(errorMessage); + + case RecorderError.NotSupported: + throw new NotSupportedException(errorMessage); + + case RecorderError.InvalidState: + case RecorderError.InvalidOperation: + case RecorderError.ResourceConflict: + throw new InvalidOperationException(errorMessage); } } } -- 2.7.4