Merge "Add a default error code when updater script aborts" am: 89394632b1 am: 18bb9a4f26

am: 7a1c2943ab

Change-Id: I56207a2e987ee09e05270b0249b5f579f1710d11
This commit is contained in:
Tianjie Xu
2017-05-03 17:46:12 +00:00
committed by android-build-merger
2 changed files with 10 additions and 7 deletions
+1
View File
@@ -24,6 +24,7 @@ enum ErrorCode {
kZipOpenFailure, kZipOpenFailure,
kBootreasonInBlacklist, kBootreasonInBlacklist,
kPackageCompatibilityFailure, kPackageCompatibilityFailure,
kScriptExecutionFailure,
}; };
enum CauseCode { enum CauseCode {
+9 -7
View File
@@ -193,13 +193,15 @@ int main(int argc, char** argv) {
} }
} }
if (state.error_code != kNoError) { // Installation has been aborted. Set the error code to kScriptExecutionFailure unless
fprintf(cmd_pipe, "log error: %d\n", state.error_code); // a more specific code has been set in errmsg.
// Cause code should provide additional information about the abort; if (state.error_code == kNoError) {
// report only when an error exists. state.error_code = kScriptExecutionFailure;
if (state.cause_code != kNoCause) { }
fprintf(cmd_pipe, "log cause: %d\n", state.cause_code); fprintf(cmd_pipe, "log error: %d\n", state.error_code);
} // Cause code should provide additional information about the abort.
if (state.cause_code != kNoCause) {
fprintf(cmd_pipe, "log cause: %d\n", state.cause_code);
} }
if (updater_info.package_zip) { if (updater_info.package_zip) {