Merge "Added some error logs to wipe" am: 719caca725
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2512335
Change-Id: I4b883b5fa0b41b9e2bb83fb69bbc1fb95395a135
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/fastboot/task.cpp b/fastboot/task.cpp
index 9268b29..9d4cb75 100644
--- a/fastboot/task.cpp
+++ b/fastboot/task.cpp
@@ -201,9 +201,13 @@
void WipeTask::Run() {
std::string partition_type;
if (fp_->fb->GetVar("partition-type:" + pname_, &partition_type) != fastboot::SUCCESS) {
+ LOG(ERROR) << "wipe task partition not found: " << pname_;
return;
}
if (partition_type.empty()) return;
- fp_->fb->Erase(pname_);
+ if (fp_->fb->Erase(pname_) != fastboot::SUCCESS) {
+ LOG(ERROR) << "wipe task erase failed with partition: " << pname_;
+ return;
+ }
fb_perform_format(pname_, 1, partition_type, "", fp_->fs_options);
}