Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f213b2c authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Added some error logs to wipe

Changed so if we call wipe on a partition that doesn't exist we'll get
some helpful error messages.

Test: tested wipe test
Bug: 194686221
Change-Id: I19dc0396a7a98d0b2be7859edbffeb8acdc9850a
parent e33e8a86
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -201,9 +201,13 @@ WipeTask::WipeTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_
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);
}