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 | |
| 20 | enum ErrorCode { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 21 | kNoError = -1, |
| 22 | kLowBattery = 20, |
| 23 | kZipVerificationFailure, |
| 24 | kZipOpenFailure, |
Tao Bao | 1d86605 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 25 | kBootreasonInBlacklist, |
| 26 | kPackageCompatibilityFailure, |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | enum CauseCode { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 30 | kNoCause = -1, |
| 31 | kArgsParsingFailure = 100, |
| 32 | kStashCreationFailure, |
| 33 | kFileOpenFailure, |
| 34 | kLseekFailure, |
| 35 | kFreadFailure, |
| 36 | kFwriteFailure, |
| 37 | kFsyncFailure, |
| 38 | kLibfecFailure, |
| 39 | kFileGetPropFailure, |
| 40 | kFileRenameFailure, |
| 41 | kSymlinkFailure, |
| 42 | kSetMetadataFailure, |
| 43 | kTune2FsFailure, |
| 44 | kRebootFailure, |
| 45 | kPackageExtractFileFailure, |
| 46 | kVendorFailure = 200 |
Tianjie Xu | 1625583 | 2016-04-30 11:49:59 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Tianjie Xu | da44cf1 | 2016-09-24 15:31:34 -0700 | [diff] [blame] | 49 | enum UncryptErrorCode { |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 50 | kUncryptNoError = -1, |
| 51 | kUncryptErrorPlaceholder = 50, |
| 52 | kUncryptTimeoutError = 100, |
| 53 | kUncryptFileRemoveError, |
| 54 | kUncryptFileOpenError, |
| 55 | kUncryptSocketOpenError, |
| 56 | kUncryptSocketWriteError, |
| 57 | kUncryptSocketListenError, |
| 58 | kUncryptSocketAcceptError, |
| 59 | kUncryptFstabReadError, |
| 60 | kUncryptFileStatError, |
| 61 | kUncryptBlockOpenError, |
| 62 | kUncryptIoctlError, |
| 63 | kUncryptReadError, |
| 64 | kUncryptWriteError, |
| 65 | kUncryptFileSyncError, |
| 66 | kUncryptFileCloseError, |
| 67 | kUncryptFileRenameError, |
| 68 | kUncryptPackageMissingError, |
Tianjie Xu | da44cf1 | 2016-09-24 15:31:34 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
Tao Bao | 2274e57 | 2016-11-14 21:29:52 -0800 | [diff] [blame] | 71 | #endif // _ERROR_CODE_H_ |