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.
18 using System.Collections.Generic;
22 namespace Tizen.Messaging.Push
24 class PushExceptionFactory
26 internal static Exception CreateResponseException(Interop.PushClient.ServiceError result)
31 case Interop.PushClient.ServiceError.OutOfMemory:
33 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.OutOfMemory");
34 exp = new InvalidOperationException("Memory Not Sufficient for the current operation");
37 case Interop.PushClient.ServiceError.InvalidParameter:
39 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.InvalidParameter");
40 exp = new InvalidOperationException("The Parameter Passed was Invalid or Invalid Operation Intented");
43 case Interop.PushClient.ServiceError.NotConnected:
45 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NotConnected");
46 exp = new InvalidOperationException("Not Connected to Server");
49 case Interop.PushClient.ServiceError.NoData:
51 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NoData");
52 exp = new InvalidOperationException("No Data");
55 case Interop.PushClient.ServiceError.OpearationFailed:
57 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.OpearationFailed");
58 exp = new InvalidOperationException("Operation Failed");
61 case Interop.PushClient.ServiceError.PermissionDenied:
63 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.PermissionDenied");
64 exp = new InvalidOperationException("Permission Denied");
67 case Interop.PushClient.ServiceError.NotSupported:
69 Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NotSupported");
70 exp = new InvalidOperationException("Not Supported");
75 Tizen.Log.Error(Interop.PushClient.LogTag, "Creating Exception for Default case for error code " + result);
76 exp = new Exception();