Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / google_apis / drive / drive_api_error_codes.h
blob62ab938f5e7640da32a54aebeac051a418b0c0ad
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_
8 #include <string>
10 namespace google_apis {
12 // HTTP errors that can be returned by Drive API service. Keep all the values
13 // positive, as they are used for UMA histograms.
14 enum DriveApiErrorCode {
15 HTTP_SUCCESS = 200,
16 HTTP_CREATED = 201,
17 HTTP_NO_CONTENT = 204,
18 HTTP_FOUND = 302,
19 HTTP_NOT_MODIFIED = 304,
20 HTTP_RESUME_INCOMPLETE = 308,
21 HTTP_BAD_REQUEST = 400,
22 HTTP_UNAUTHORIZED = 401,
23 HTTP_FORBIDDEN = 403,
24 HTTP_NOT_FOUND = 404,
25 HTTP_CONFLICT = 409,
26 HTTP_GONE = 410,
27 HTTP_LENGTH_REQUIRED = 411,
28 HTTP_PRECONDITION = 412,
29 HTTP_INTERNAL_SERVER_ERROR = 500,
30 HTTP_NOT_IMPLEMENTED = 501,
31 HTTP_BAD_GATEWAY = 502,
32 HTTP_SERVICE_UNAVAILABLE = 503,
33 DRIVE_PARSE_ERROR = 1000,
34 DRIVE_FILE_ERROR = 1001,
35 DRIVE_CANCELLED = 1002,
36 DRIVE_OTHER_ERROR = 1003,
37 DRIVE_NO_CONNECTION = 1004,
38 DRIVE_NOT_READY = 1005,
39 DRIVE_NO_SPACE = 1006,
40 DRIVE_RESPONSE_TOO_LARGE = 1007
41 // If modified, update the enum mapping in histograms.xml.
44 // Returns a string representation of DriveApiErrorCode.
45 std::string DriveApiErrorCodeToString(DriveApiErrorCode error);
47 // Checks if the error code represents success.
48 bool IsSuccessfulDriveApiErrorCode(DriveApiErrorCode error);
50 } // namespace google_apis
52 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_