blob: 0e79c87ca1deb61bad1e507d5c1aca814d8d8d40 [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 Xu16255832016-04-30 11:49:59 -070028};
29
30enum CauseCode {
Tao Bao2274e572016-11-14 21:29:52 -080031 kNoCause = -1,
32 kArgsParsingFailure = 100,
33 kStashCreationFailure,
34 kFileOpenFailure,
35 kLseekFailure,
36 kFreadFailure,
37 kFwriteFailure,
38 kFsyncFailure,
39 kLibfecFailure,
40 kFileGetPropFailure,
41 kFileRenameFailure,
42 kSymlinkFailure,
43 kSetMetadataFailure,
44 kTune2FsFailure,
45 kRebootFailure,
46 kPackageExtractFileFailure,
47 kVendorFailure = 200
Tianjie Xu16255832016-04-30 11:49:59 -070048};
49
Tianjie Xuda44cf12016-09-24 15:31:34 -070050enum UncryptErrorCode {
Tao Bao2274e572016-11-14 21:29:52 -080051 kUncryptNoError = -1,
52 kUncryptErrorPlaceholder = 50,
53 kUncryptTimeoutError = 100,
54 kUncryptFileRemoveError,
55 kUncryptFileOpenError,
56 kUncryptSocketOpenError,
57 kUncryptSocketWriteError,
58 kUncryptSocketListenError,
59 kUncryptSocketAcceptError,
60 kUncryptFstabReadError,
61 kUncryptFileStatError,
62 kUncryptBlockOpenError,
63 kUncryptIoctlError,
64 kUncryptReadError,
65 kUncryptWriteError,
66 kUncryptFileSyncError,
67 kUncryptFileCloseError,
68 kUncryptFileRenameError,
69 kUncryptPackageMissingError,
Tianjie Xuda44cf12016-09-24 15:31:34 -070070};
71
Tao Bao2274e572016-11-14 21:29:52 -080072#endif // _ERROR_CODE_H_