|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: error code conversion |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include <in_iface.h> |
|
22 #include "nsmldmerror.h" |
|
23 |
|
24 |
|
25 // --------------------------------------------------------- |
|
26 // TNSmlDMError::TNSmlDMError() |
|
27 // Constructor, nothing special in here. |
|
28 // --------------------------------------------------------- |
|
29 // |
|
30 TNSmlDMError::TNSmlDMError():TNSmlError() |
|
31 { |
|
32 } |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // TNSmlDMError::SyncLogMessage() |
|
36 // Converts native error code to message code for UI |
|
37 // |
|
38 // --------------------------------------------------------- |
|
39 TInt TNSmlDMError::SyncLogMessageCode() |
|
40 { |
|
41 TInt syncLogMessage; |
|
42 if ( iErrorCode == ESmlServerSessionAbort ) |
|
43 { |
|
44 syncLogMessage = ESessionAborted; |
|
45 } |
|
46 else |
|
47 { |
|
48 TNSmlError::TNSmlCommonAgentMessage commonMessage = (TNSmlCommonAgentMessage) TNSmlError::SyncLogMessageCode(); |
|
49 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::EServerSystemError ) ) |
|
50 { |
|
51 syncLogMessage = EServerSystemError; |
|
52 } |
|
53 else |
|
54 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ESyncMLError ) ) |
|
55 { |
|
56 syncLogMessage = ESyncMLError; |
|
57 } |
|
58 else |
|
59 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ESyncMLCommandNotSupported ) ) |
|
60 { |
|
61 syncLogMessage = ESyncMLCommandNotSupported; |
|
62 } |
|
63 else |
|
64 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ESyncMLVersionNotSupported ) ) |
|
65 { |
|
66 syncLogMessage = ESyncMLVersionNotSupported; |
|
67 } |
|
68 else |
|
69 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::EUnsupportedContentTypeOrFormat ) ) |
|
70 { |
|
71 syncLogMessage = EUnsupportedContentTypeOrFormat; |
|
72 } |
|
73 else |
|
74 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ESyncMLClientAuthenticationError ) ) |
|
75 { |
|
76 syncLogMessage = ESyncMLClientAuthenticationError; |
|
77 } |
|
78 else |
|
79 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ESyncMLServerAuthenticationError ) ) |
|
80 { |
|
81 syncLogMessage = ESyncMLServerAuthenticationError; |
|
82 } |
|
83 else |
|
84 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::EServerBusy ) ) |
|
85 { |
|
86 syncLogMessage = EServerBusy; |
|
87 } |
|
88 else |
|
89 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::EServerNotResponding ) ) |
|
90 { |
|
91 syncLogMessage = EServerNotResponding; |
|
92 } |
|
93 else |
|
94 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::EInvalidURI ) ) |
|
95 { |
|
96 syncLogMessage = EInvalidURI; |
|
97 } |
|
98 else |
|
99 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ECommunicationError ) ) |
|
100 { |
|
101 syncLogMessage = ECommunicationError; |
|
102 } |
|
103 // 1.2 CHANGES: Offline mode |
|
104 else |
|
105 if ( commonMessage == TNSmlError::TNSmlCommonAgentMessage( TNSmlError::ENotPossibleInOfflineMode ) ) |
|
106 { |
|
107 syncLogMessage = ENotPossibleInOfflineMode; |
|
108 } |
|
109 // Changes end |
|
110 else |
|
111 { |
|
112 syncLogMessage = ESystemError; |
|
113 } |
|
114 } |
|
115 return syncLogMessage; |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------- |
|
119 // TNSmlDMError::ErrorCodeConversion() |
|
120 // Converts some error code to Symbian error codes |
|
121 // --------------------------------------------------------- |
|
122 void TNSmlDMError::ErrorCodeConversion() |
|
123 { |
|
124 TNSmlError::ErrorCodeConversion(); |
|
125 } |
|
126 |