OSDN Git Service

Make dex file loading failure more explicit about failure.
authorAlex Light <allight@google.com>
Wed, 20 Apr 2016 21:26:34 +0000 (14:26 -0700)
committerAlex Light <allight@google.com>
Wed, 20 Apr 2016 21:31:03 +0000 (14:31 -0700)
We make sure that if we fail to load a dex file due to having an
unsupported dex version number we will say so explicitly in the
exceptions.

Bug: 28269864
Change-Id: I3c61d088cd0d04cf2a02246e69a4161180e3f2d8

runtime/oat_file_manager.cc

index 3846605..9894353 100644 (file)
@@ -449,7 +449,8 @@ std::vector<std::unique_ptr<const DexFile>> OatFileManager::OpenDexFilesFromOat(
       if (Runtime::Current()->IsDexFileFallbackEnabled()) {
         if (!DexFile::Open(dex_location, dex_location, /*out*/ &error_msg, &dex_files)) {
           LOG(WARNING) << error_msg;
-          error_msgs->push_back("Failed to open dex files from " + std::string(dex_location));
+          error_msgs->push_back("Failed to open dex files from " + std::string(dex_location)
+                                + " because: " + error_msg);
         }
       } else {
         error_msgs->push_back("Fallback mode disabled, skipping dex files.");