@@ -924,7 +924,8 @@ def generate_js(data_target, data_files, metadata):
924
924
var getRequest = packages.get(`package/${packageName}/${chunkId}`);
925
925
getRequest.onsuccess = (event) => {
926
926
if (!event.target.result) {
927
- return errback(new Error(`CachedPackageNotFound for: ${packageName}`));
927
+ errback(new Error(`CachedPackageNotFound for: ${packageName}`));
928
+ return;
928
929
}
929
930
// If there's only 1 chunk, there's nothing to concatenate it with so we can just return it now
930
931
if (chunkCount == 1) {
@@ -963,7 +964,7 @@ def generate_js(data_target, data_files, metadata):
963
964
if (isNode) {
964
965
require('fs').readFile(packageName, (err, contents) => {
965
966
if (err) {
966
- return errback(err);
967
+ errback(err);
967
968
} else {
968
969
callback(contents.buffer);
969
970
}
@@ -1117,7 +1118,7 @@ def generate_js(data_target, data_files, metadata):
1117
1118
if (isNode) {
1118
1119
require('fs').readFile(metadataUrl, 'utf8', (err, contents) => {
1119
1120
if (err) {
1120
- return handleError (err);
1121
+ throwPackageError (err);
1121
1122
} else {
1122
1123
loadPackage(JSON.parse(contents));
1123
1124
}
@@ -1139,9 +1140,9 @@ def generate_js(data_target, data_files, metadata):
1139
1140
return response.json();
1140
1141
}
1141
1142
})
1142
- .catch((cause) => {
1143
- return handleError (new Error(`Network Error: ${packageName}`, {cause})
1144
- }) ) // If fetch fails, rewrite the error to include the failing URL & the cause.
1143
+ .catch((cause) =>
1144
+ throwPackageError (new Error(`Network Error: ${packageName}`, {cause}) )
1145
+ ) // If fetch fails, rewrite the error to include the failing URL & the cause.
1145
1146
.then(loadPackage);
1146
1147
}
1147
1148
0 commit comments