Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-adapter / sa_error.h
1 /*
2  * oma-ds-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /**
19  *   @SA_Error.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file of Error is defined
22  */
23
24 #ifndef SA_ERROR_H_
25 #define SA_ERROR_H_
26
27 typedef enum {
28         ERROR_UNKNOWN = 0,
29
30         /* Informational */
31         IN_PROGRESS = 101,
32
33         /* OK code */
34         /** No error */
35         NO_ERROR = 200,
36         /** Requested item was added */
37         ITEM_ADDED = 201,
38         /** Accepted for processing */
39         PROCESSING_ACCEPTED = 202,
40         /** Non-authoritative response */
41         NON_AUTHORITATIVE = 203,
42         /** No content */
43         NO_CONTENT = 204,
44         /** Reset content */
45         RESET_CONTENT = 205,
46         /** Partial content */
47         PARTIAL_CONTENT = 206,
48         /** Conflict resolved with merge */
49         CONFLICT_MERGE = 207,
50         /** Conflict resolved with client win */
51         CONFLICT_CLIENT_WIN = 208,
52         /** Conflict resolved with duplicate */
53         CONFLICT_DUPLICATE = 209,
54         /** Deleted without archiving */
55         DELETE_NO_ARCHIVE = 210,
56         /** Item not deleted (not found) */
57         DELETE_NOT_FOUND = 211,
58         /** Authentication accepted */
59         AUTH_ACCEPTED = 212,
60         /** Chunked item accepted */
61         CHUNK_ACCEPTED = 213,
62         /** Operation cancelled */
63         OPERATION_CANCELLED = 214,
64         /** Not executed */
65         NOT_EXECUTED = 215,
66         /** Atomic rollback ok */
67         ATOMIC_ROLLBACK_OK = 216,
68
69         /* Retry error */
70         ERROR_MULTIPLE_CHOICES = 300,
71         ERROR_MOVED_PERMANENTLY = 301,
72         ERROR_FOUND_RETRY = 302,
73         ERROR_SEE_OTHER_RETRY = 303,
74         ERROR_NOT_MODIFIED = 304,
75         ERROR_USE_PROXY = 305,
76
77         /* Errors */
78         ERROR_BAD_REQUEST = 400,        /* Bad Request */
79         ERROR_AUTH_REJECTED = 401,      /* Unauthorized, Invalid Credentials */
80         ERROR_PAYMENT_NEEDED = 402,     /* Payment need */
81         ERROR_FORBIDDEN = 403,  /* Forbidden */
82         ERROR_NOT_FOUND = 404,  /* Not found */
83         ERROR_COMMAND_NOT_ALLOWED = 405,        /* Command not allowed */
84         ERROR_UNSUPPORTED_FEATURE = 406,        /* Optional feature unsupported */
85         ERROR_AUTH_REQUIRED = 407,      /* Authentication required, Missing Credentials */
86         ERROR_SIZE_REQUIRED = 411,
87         ERROR_REQUESTED_SIZE_TOO_BIG = 416,
88         ERROR_RETRY_LATER = 417,        /* Retry later */
89         ERROR_ALREADY_EXISTS = 418,     /* Put or Add failed because item already exists */
90         ERROR_SIZE_MISMATCH = 424,      /* Size mismatch */
91
92         /* Standard errors */
93         ERROR_GENERIC = 500,
94         ERROR_NOT_IMPLEMENTED = 501,
95         ERROR_SERVICE_UNAVAILABLE = 503,
96         ERROR_REQUIRE_REFRESH = 508,
97         ERROR_SERVER_FAILURE = 511,
98
99 } oma_status_type_e;
100
101 typedef enum {
102
103         /* Internal errors - never ever send this via SyncML */
104         SA_ERROR_UNKNOWN = 0,
105         SA_INTERNAL_OK = 1,
106         SA_INTERNAL_ERROR,
107         SA_INTERNAL_BINDER_ERROR,
108         SA_INTERNAL_TIMEOUT,
109         SA_INTERNAL_NOT_FOUND,
110         SA_INTERNAL_MISCONFIGURATION,
111         SA_INTERNAL_NO_MEMORY,
112         SA_INTERNAL_NOT_DEFINED,
113         SA_INTERNAL_CONNECTION_ERROR,
114         SA_INTERNAL_DA_ERROR,
115         SA_INTERNAL_CANCEL,
116         SA_INTERNAL_AUTOCONFIG_NOT_SUPPORT_BY_SERVER,
117         SA_INTERNAL_BUSY_SIGNALING,
118         SA_INTERNAL_SERVER_FAILURE,
119         SA_INTERNAL_SERVER_ERROR,
120         SA_INTERNAL_AUTHENTICATION_ERROR,
121         SA_INTERNAL_SUSPEND_FAIL,
122 } sa_error_type_e;
123
124 #endif                          /* SA_ERROR_H_ */