2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 using Tizen.Internals.Errors;
22 namespace Tizen.Multimedia
25 /// Enumeration for metadata extractor's error codes.
27 internal enum MetadataEditorError
29 None = ErrorCode.None, // Success
30 InvalidParameter = ErrorCode.InvalidParameter, // Invalid parameter
31 OutOfMemory = ErrorCode.OutOfMemory, // Out of memory
32 FileNotExists = ErrorCode.FileExists, // File does not exist
33 PermissionDenied = ErrorCode.PermissionDenied, // Permission deny
34 NotSupported = ErrorCode.NotSupported, // Unsupported type
35 TizenMetadataEditorError = -0x019C0000,
36 OperationFailed = TizenMetadataEditorError | 0x01 // Invalid operation
39 internal static class MetadataEditorErrorFactory
41 internal static void ThrowIfError(MetadataEditorError errorCode, string errorMessage)
45 case MetadataEditorError.InvalidParameter:
46 throw new ArgumentException(errorMessage);
48 case MetadataEditorError.OutOfMemory:
49 throw new OutOfMemoryException(errorMessage);
51 case MetadataEditorError.FileNotExists:
52 throw new FileNotFoundException(errorMessage);
54 case MetadataEditorError.PermissionDenied:
55 throw new UnauthorizedAccessException(errorMessage);
57 case MetadataEditorError.NotSupported:
58 throw new NotSupportedException(errorMessage);
60 case MetadataEditorError.OperationFailed:
61 throw new InvalidOperationException(errorMessage);