summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Aboy Solanes <solanes@google.com>2024-04-30 17:01:51 +0100
committerSantiago Aboy Solanes <solanes@google.com>2024-05-01 07:22:26 +0000
commitc485affa72ed3429166cf036934ccaf21bee01d2 (patch)
tree68a84c86e9fd6c2c48925f664a9ef01baffe56f8
parent89e4ca0ccf8424c8f4ac170504c55f5ee767b95c (diff)
downloadart-c485affa72ed3429166cf036934ccaf21bee01d2.tar.gz
Improve error handling in ImageSpace::LoadBootImage
There's only one string so there's no need to push it back into a vector Test: Presubmit Change-Id: I2cc8dd8bd8bc282ab8efabefe8a2eb22a4c89377
-rw-r--r--runtime/gc/space/image_space.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 852039a206..9f24b310c3 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -3348,9 +3348,6 @@ bool ImageSpace::LoadBootImage(const std::vector<std::string>& boot_class_path,
&apex_versions);
loader.FindImageFiles();
- // Collect all the errors.
- std::vector<std::string> error_msgs;
-
std::string error_msg;
if (loader.LoadFromSystem(extra_reservation_size,
allow_in_memory_compilation,
@@ -3359,22 +3356,10 @@ bool ImageSpace::LoadBootImage(const std::vector<std::string>& boot_class_path,
&error_msg)) {
return true;
}
- error_msgs.push_back(error_msg);
-
- std::ostringstream oss;
- bool first = true;
- for (const auto& msg : error_msgs) {
- if (first) {
- first = false;
- } else {
- oss << "\n ";
- }
- oss << msg;
- }
-
LOG(ERROR) << "Could not create image space with image file '"
- << Join(image_locations, kComponentSeparator) << "'. Attempting to fall back to imageless "
- << "running. Error was: " << oss.str();
+ << Join(image_locations, kComponentSeparator)
+ << "'. Attempting to fall back to imageless running. Error was: "
+ << error_msg;
return false;
}