mirror of https://github.com/status-im/metro.git
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:
parent
f19e5215cf
commit
e5197e940e
|
@ -202,7 +202,8 @@ function unknownModuleError(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function moduleThrewError(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__) {
|
if (__DEV__) {
|
||||||
|
|
Loading…
Reference in New Issue