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