Skip to content

Commit 82c8224

Browse files
committed
Log instead of throwing parsing manifests.
1 parent 26ecf64 commit 82c8224

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

library/src/main/java/com/bumptech/glide/module/ManifestParser.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ public List<GlideModule> parse() {
6060
}
6161
}
6262
}
63+
if (Log.isLoggable(TAG, Log.DEBUG)) {
64+
Log.d(TAG, "Finished loading Glide modules");
65+
}
6366
} catch (PackageManager.NameNotFoundException e) {
64-
throw new RuntimeException("Unable to find metadata to parse GlideModules", e);
65-
}
66-
if (Log.isLoggable(TAG, Log.DEBUG)) {
67-
Log.d(TAG, "Finished loading Glide modules");
67+
if (Log.isLoggable(TAG, Log.ERROR)) {
68+
Log.e(TAG, "Failed to parse glide modules", e);
69+
}
6870
}
6971

7072
return modules;

library/test/src/test/java/com/bumptech/glide/module/ManifestParserTest.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,12 @@ public void parse_withNullMetadata_doesNotThrow() throws NameNotFoundException {
125125
}
126126

127127
@Test
128-
public void parse_withMissingName_throwsRuntimeException() throws NameNotFoundException {
128+
public void parse_withMissingName_doesNotThrow() throws NameNotFoundException {
129129
PackageManager pm = mock(PackageManager.class);
130130
doThrow(new NameNotFoundException("name")).when(pm).getApplicationInfo(anyString(), anyInt());
131131
when(context.getPackageManager()).thenReturn(pm);
132132

133-
assertThrows(
134-
"Unable to find metadata to parse GlideModules",
135-
RuntimeException.class,
136-
new ThrowingRunnable() {
137-
@Override
138-
public void run() {
139-
parser.parse();
140-
}
141-
});
133+
parser.parse();
142134
}
143135

144136
private void addModuleToManifest(Class<?> moduleClass) {

0 commit comments

Comments
 (0)