android::base::ResultError/Error are template classes
They are changed to template classes. s/Error/Error<>/g to reflect that.
In addition, the direct uses of ResultError for error reporting is
replaced with Error and Errorf.
Bug: 209929099
Test: m
Change-Id: I815526a8e6fa30e63fa3efcf5700b146bf70a507
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 8045c71..cc445be 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -88,6 +88,7 @@
using namespace std::literals::string_literals;
using android::base::Basename;
+using android::base::ResultError;
using android::base::SetProperty;
using android::base::Split;
using android::base::StartsWith;
@@ -116,7 +117,7 @@
android::base::GetMinimumLogSeverity() > android::base::DEBUG) {}
template <typename T>
- operator android::base::expected<T, ResultError>() {
+ operator android::base::expected<T, ResultError<int>>() {
if (ignore_error_) {
return {};
}
@@ -130,7 +131,7 @@
}
private:
- Error error_;
+ Error<> error_;
bool ignore_error_;
};
diff --git a/init/subcontext.cpp b/init/subcontext.cpp
index 6eaa80f..7aa4a9d 100644
--- a/init/subcontext.cpp
+++ b/init/subcontext.cpp
@@ -297,7 +297,7 @@
if (subcontext_reply->reply_case() == SubcontextReply::kFailure) {
auto& failure = subcontext_reply->failure();
- return ResultError(failure.error_string(), failure.error_errno());
+ return ResultError<>(failure.error_string(), failure.error_errno());
}
if (subcontext_reply->reply_case() != SubcontextReply::kSuccess) {
@@ -321,7 +321,7 @@
if (subcontext_reply->reply_case() == SubcontextReply::kFailure) {
auto& failure = subcontext_reply->failure();
- return ResultError(failure.error_string(), failure.error_errno());
+ return ResultError<>(failure.error_string(), failure.error_errno());
}
if (subcontext_reply->reply_case() != SubcontextReply::kExpandArgsReply) {