Permalink
Browse files

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
  • Loading branch information...
davidaurelio authored and facebook-github-bot committed Mar 20, 2017
1 parent 68c7739 commit 14fee735a2fde73f1e505543ee40af0df66f63aa
Showing with 2 additions and 1 deletion.
  1. +2 −1 packager/src/Resolver/polyfills/require.js
@@ -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__) {

0 comments on commit 14fee73

Please sign in to comment.