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:
David Aurelio
2017-03-20 08:31:42 -07:00
committed by Facebook Github Bot
parent 68c77395b1
commit 14fee735a2
+2 -1
View File
@@ -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__) {