Return the error reason to the caller of SetTargetChannel.
This patch sends back to the caller an error message indicating why the
channel change didn't work.
Bug: 25595865
Test: Deployed on a device and attempted to change to "foo" channel. Error message lists available channels.
Test: FEATURES=test emerge-link update_engine
Change-Id: Idcc67d5c7878ce7af60652d7bf5bf81135325f97
diff --git a/update_attempter.cc b/update_attempter.cc
index 09dd108..7d6aaf2 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -381,7 +381,11 @@
LOG(INFO) << "Setting target channel as mandated: " << target_channel;
// Pass in false for powerwash_allowed until we add it to the policy
// protobuf.
- omaha_request_params_->SetTargetChannel(target_channel, false);
+ string error_message;
+ if (!omaha_request_params_->SetTargetChannel(target_channel, false,
+ &error_message)) {
+ LOG(ERROR) << "Setting the channel failed: " << error_message;
+ }
// Since this is the beginning of a new attempt, update the download
// channel. The download channel won't be updated until the next attempt,