Improve logging when source hash mismatches.
When applying an operation, the source hash may mismatch the one the
payload expects. The current log only shows the operation number across
all operations in the payload. This patch also includes the operation
number in the current partition and the partition name.
Bug: 28626303
TEST=deployed the wrong delta payload and saw the partition name and number.
Change-Id: I8d6d1639deffbc360fa7a02448d1ad28fa80aafe
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index d955d03..5ad1d46 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -249,8 +249,13 @@
if (op_result)
return true;
+ size_t partition_first_op_num =
+ current_partition_ ? acc_num_operations_[current_partition_ - 1] : 0;
LOG(ERROR) << "Failed to perform " << op_type_name << " operation "
- << next_operation_num_;
+ << next_operation_num_ << ", which is the operation "
+ << next_operation_num_ - partition_first_op_num
+ << " in partition \""
+ << partitions_[current_partition_].partition_name() << "\"";
*error = ErrorCode::kDownloadOperationExecutionError;
return false;
}