throw IllegalArgumentException instead of AssertionError when JS module is not found
Reviewed By: astreet Differential Revision: D3190875 fb-gh-sync-id: ac34872d8d36247a8bb28bdfbf985ebcdadd4e33 fbshipit-source-id: ac34872d8d36247a8bb28bdfbf985ebcdadd4e33
This commit is contained in:
parent
42cfba558f
commit
a3ef44b4ba
|
@ -59,10 +59,11 @@ public class JavaScriptModuleRegistry {
|
|||
return (T) module;
|
||||
}
|
||||
|
||||
JavaScriptModuleRegistration registration =
|
||||
Assertions.assertNotNull(
|
||||
mModuleRegistrations.get(moduleInterface),
|
||||
"JS module " + moduleInterface.getSimpleName() + " hasn't been registered!");
|
||||
JavaScriptModuleRegistration registration = mModuleRegistrations.get(moduleInterface);
|
||||
if (registration == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"JS module " + moduleInterface.getSimpleName() + " hasn't been registered!");
|
||||
}
|
||||
JavaScriptModule interfaceProxy = (JavaScriptModule) Proxy.newProxyInstance(
|
||||
moduleInterface.getClassLoader(),
|
||||
new Class[]{moduleInterface},
|
||||
|
|
Loading…
Reference in New Issue