fix: Log single bundle error to browser console

This commit is contained in:
1ambda 2017-03-31 19:40:52 +09:00
parent a99f981d3b
commit 5a2a9384cc
2 changed files with 8 additions and 6 deletions

View file

@ -151,7 +151,13 @@ export default function heliumService($http, $sce, baseUrlSrv) {
return $http.get(url)
.then(function(response, status) {
return response.data;
const bundle = response.data
if (bundle.substring(0, 'ERROR:'.length) === 'ERROR:') {
console.error(`Failed to get bundle: ${pkgName}`, bundle);
return '' // empty bundle will be filtered later
}
return bundle
})
.catch(function(error) {
console.error(`Failed to get single bundle: ${pkgName}`, error);
@ -260,10 +266,6 @@ export default function heliumService($http, $sce, baseUrlSrv) {
// load should be promise
this.load = p.then(availableBundles => {
// if (response.substring(0, 'ERROR:'.length) === 'ERROR:') {
// console.error(response);
// return
// }
// evaluate bundles
availableBundles.map(b => {

View file

@ -272,7 +272,7 @@ public class HeliumBundleFactory {
// remove postfix `.js` for ES6 import
if (mainFileName.endsWith(".js")) {
mainFileName = mainFileName.substring(0, mainFileName.length() - 2);
mainFileName = mainFileName.substring(0, mainFileName.length() - 3);
}
loadJsImport