mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use verbose module name when requiring module that errored
Summary: When requiring a module that has previously errored, the implementation of `require` only used the numerical module ID. In this diff, we enable usage of the verbose module name if present. Reviewed By: bestander Differential Revision: D4737723 fbshipit-source-id: 1c2d3906435a637f3e440e57f904489d84495bd2
This commit is contained in:
committed by
Facebook Github Bot
parent
68c77395b1
commit
14fee735a2
@@ -202,7 +202,8 @@ function unknownModuleError(id) {
|
||||
}
|
||||
|
||||
function moduleThrewError(id) {
|
||||
return Error('Requiring module "' + id + '", which threw an exception.');
|
||||
const displayName = __DEV__ && modules[id] && modules[id].verboseName || id;
|
||||
return Error('Requiring module "' + displayName + '", which threw an exception.');
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
|
||||
Reference in New Issue
Block a user