blob: 4e3032bc90ef90a821598c6a12647e89d96cd149 [file] [log] [blame]
Tianjie Xu16255832016-04-30 11:49:59 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef _ERROR_CODE_H_
18#define _ERROR_CODE_H_
19
20enum ErrorCode {
Tao Bao2274e572016-11-14 21:29:52 -080021 kNoError = -1,
22 kLowBattery = 20,
23 kZipVerificationFailure,
24 kZipOpenFailure,
Tao Bao1d866052017-04-10 16:55:57 -070025 kBootreasonInBlacklist,
26 kPackageCompatibilityFailure,
Tianjie Xue0c88792017-05-02 16:07:18 -070027 kScriptExecutionFailure,
Tianjie Xu3fec8c62017-08-23 00:18:07 -070028 kMapFileFailure,
29 kForkUpdateBinaryFailure,
30 kUpdateBinaryCommandFailure,
Tianjie Xu16255832016-04-30 11:49:59 -070031};
32
33enum CauseCode {
Tao Bao2274e572016-11-14 21:29:52 -080034 kNoCause = -1,
35 kArgsParsingFailure = 100,
36 kStashCreationFailure,
37 kFileOpenFailure,
38 kLseekFailure,
39 kFreadFailure,
40 kFwriteFailure,
41 kFsyncFailure,
42 kLibfecFailure,
43 kFileGetPropFailure,
44 kFileRenameFailure,
45 kSymlinkFailure,
46 kSetMetadataFailure,
47 kTune2FsFailure,
48 kRebootFailure,
49 kPackageExtractFileFailure,
Tianjie Xu69575552017-05-16 15:51:46 -070050 kPatchApplicationFailure,
Tao Bao2274e572016-11-14 21:29:52 -080051 kVendorFailure = 200
Tianjie Xu16255832016-04-30 11:49:59 -070052};
53
Tianjie Xuda44cf12016-09-24 15:31:34 -070054enum UncryptErrorCode {
Tao Bao2274e572016-11-14 21:29:52 -080055 kUncryptNoError = -1,
56 kUncryptErrorPlaceholder = 50,
57 kUncryptTimeoutError = 100,
58 kUncryptFileRemoveError,
59 kUncryptFileOpenError,
60 kUncryptSocketOpenError,
61 kUncryptSocketWriteError,
62 kUncryptSocketListenError,
63 kUncryptSocketAcceptError,
64 kUncryptFstabReadError,
65 kUncryptFileStatError,
66 kUncryptBlockOpenError,
67 kUncryptIoctlError,
68 kUncryptReadError,
69 kUncryptWriteError,
70 kUncryptFileSyncError,
71 kUncryptFileCloseError,
72 kUncryptFileRenameError,
73 kUncryptPackageMissingError,
Tianjie Xu8b8e23d2017-07-27 11:42:17 -070074 kUncryptRealpathFindError,
75 kUncryptBlockDeviceFindError,
Tianjie Xuda44cf12016-09-24 15:31:34 -070076};
77
Tao Bao2274e572016-11-14 21:29:52 -080078#endif // _ERROR_CODE_H_