2 * Copyright (c) 2017 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.
17 namespace Tizen.Applications.Shortcut
21 internal static class ShortcutErrorFactory
23 private const string LogTag = "Tizen.Applications.Shortcut";
25 internal static Exception GetException(Interop.Shortcut.ErrorCode err, string msg)
29 case Interop.Shortcut.ErrorCode.InvalidParameter:
30 return new ArgumentException(err + " error occurred.");
31 case Interop.Shortcut.ErrorCode.PermissionDenied:
32 return new UnauthorizedAccessException(err + " Permission denied (http://tizen.org/privilege/shortcut)");
33 case Interop.Shortcut.ErrorCode.NotSupported:
34 return new NotSupportedException(err + " Not Supported (http://tizen.org/feature/shortcut)");
35 case Interop.Shortcut.ErrorCode.OutOfMemory:
36 return new OutOfMemoryException(err + " error occurred.");
38 Log.Error(LogTag, msg);
39 return new InvalidOperationException(err + " error occurred.");