mirror of
https://github.com/status-im/react-native.git
synced 2025-03-01 01:20:31 +00:00
Improve error handling in route generation script
Reviewed By: sam-swarr Differential Revision: D3282748 fbshipit-source-id: 17301c6639a7517d1171a67567f220471020b78d
This commit is contained in:
parent
9b56ff6bab
commit
1b5b5d9c5b
@ -68,7 +68,9 @@ var SourceMapsUtils = {
|
|||||||
return Promise.reject(new Error('RCTNetworking module is not available'));
|
return Promise.reject(new Error('RCTNetworking module is not available'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return RCTSourceCode.getScriptText()
|
const scriptText = RCTSourceCode.getScriptText();
|
||||||
|
if (scriptText) {
|
||||||
|
scriptText
|
||||||
.then(SourceMapsUtils.extractSourceMapURL)
|
.then(SourceMapsUtils.extractSourceMapURL)
|
||||||
.then((url) => {
|
.then((url) => {
|
||||||
if (url === null) {
|
if (url === null) {
|
||||||
@ -76,6 +78,11 @@ var SourceMapsUtils = {
|
|||||||
}
|
}
|
||||||
return Promise.resolve(url);
|
return Promise.resolve(url);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Running in mock-config mode
|
||||||
|
return Promise.reject(new Error('Couldn\'t fetch script text'));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user