Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Tao Bao | 0bf20d5 | 2017-10-05 12:06:49 -0700 | [diff] [blame] | 20 | enum ErrorCode : int { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 21 | kNoError = -1, |
| 22 | kLowBattery = 20, |
| 23 | kZipVerificationFailure, |
| 24 | kZipOpenFailure, |
Tianjie | 1bc976a | 2020-07-22 17:25:11 -0700 | [diff] [blame] | 25 | kBootreasonInBlocklist, |
Tao Bao | 1d86605 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 26 | kPackageCompatibilityFailure, |
Tianjie Xu | e0c8879 | 2017-05-02 16:07:18 -0700 | [diff] [blame] | 27 | kScriptExecutionFailure, |
Tianjie Xu | 3fec8c6 | 2017-08-23 00:18:07 -0700 | [diff] [blame] | 28 | kMapFileFailure, |
| 29 | kForkUpdateBinaryFailure, |
| 30 | kUpdateBinaryCommandFailure, |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 31 | }; |
| 32 | |
Tao Bao | 0bf20d5 | 2017-10-05 12:06:49 -0700 | [diff] [blame] | 33 | enum CauseCode : int { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 34 | 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 Xu | 6957555 | 2017-05-16 15:51:46 -0700 | [diff] [blame] | 50 | kPatchApplicationFailure, |
Tianjie Xu | 69ffa15 | 2018-08-01 16:40:00 -0700 | [diff] [blame] | 51 | kHashTreeComputationFailure, |
Tianjie Xu | 22f1120 | 2018-08-27 10:50:31 -0700 | [diff] [blame] | 52 | kEioFailure, |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 53 | kVendorFailure = 200 |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
Tao Bao | 0bf20d5 | 2017-10-05 12:06:49 -0700 | [diff] [blame] | 56 | enum UncryptErrorCode : int { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 57 | kUncryptNoError = -1, |
| 58 | kUncryptErrorPlaceholder = 50, |
| 59 | kUncryptTimeoutError = 100, |
| 60 | kUncryptFileRemoveError, |
| 61 | kUncryptFileOpenError, |
| 62 | kUncryptSocketOpenError, |
| 63 | kUncryptSocketWriteError, |
| 64 | kUncryptSocketListenError, |
| 65 | kUncryptSocketAcceptError, |
| 66 | kUncryptFstabReadError, |
| 67 | kUncryptFileStatError, |
| 68 | kUncryptBlockOpenError, |
| 69 | kUncryptIoctlError, |
| 70 | kUncryptReadError, |
| 71 | kUncryptWriteError, |
| 72 | kUncryptFileSyncError, |
| 73 | kUncryptFileCloseError, |
| 74 | kUncryptFileRenameError, |
| 75 | kUncryptPackageMissingError, |
Tianjie Xu | 8b8e23d | 2017-07-27 11:42:17 -0700 | [diff] [blame] | 76 | kUncryptRealpathFindError, |
| 77 | kUncryptBlockDeviceFindError, |
Tianjie Xu | da44cf1 | 2016-09-24 15:31:34 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
Tao Bao | 1fc5bf3 | 2017-10-06 07:43:41 -0700 | [diff] [blame] | 80 | #endif // _ERROR_CODE_H_ |