diff --git a/library/src/main/java/com/bumptech/glide/module/ManifestParser.java b/library/src/main/java/com/bumptech/glide/module/ManifestParser.java index b3834f3e8c..35fce96e56 100644 --- a/library/src/main/java/com/bumptech/glide/module/ManifestParser.java +++ b/library/src/main/java/com/bumptech/glide/module/ManifestParser.java @@ -60,11 +60,13 @@ public List parse() { } } } + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "Finished loading Glide modules"); + } } catch (PackageManager.NameNotFoundException e) { - throw new RuntimeException("Unable to find metadata to parse GlideModules", e); - } - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Finished loading Glide modules"); + if (Log.isLoggable(TAG, Log.ERROR)) { + Log.e(TAG, "Failed to parse glide modules", e); + } } return modules; diff --git a/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java b/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java index 7dcdb06374..86de11b400 100644 --- a/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java +++ b/library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java @@ -125,20 +125,12 @@ public void parse_withNullMetadata_doesNotThrow() throws NameNotFoundException { } @Test - public void parse_withMissingName_throwsRuntimeException() throws NameNotFoundException { + public void parse_withMissingName_doesNotThrow() throws NameNotFoundException { PackageManager pm = mock(PackageManager.class); doThrow(new NameNotFoundException("name")).when(pm).getApplicationInfo(anyString(), anyInt()); when(context.getPackageManager()).thenReturn(pm); - assertThrows( - "Unable to find metadata to parse GlideModules", - RuntimeException.class, - new ThrowingRunnable() { - @Override - public void run() { - parser.parse(); - } - }); + parser.parse(); } private void addModuleToManifest(Class moduleClass) {