Don't pipe mp3.js through babel, add respack fetch error

master
William Toohey 10 years ago
parent 10625e0f46
commit ccd52f5a87
  1. 1
      gulpfile.js
  2. 5
      src/js/ResourcePack.js

@ -32,7 +32,6 @@ gulp.task('css', function(){
gulp.task("mp3", function () { gulp.task("mp3", function () {
return gulp.src("src/js/mp3/*.js") return gulp.src("src/js/mp3/*.js")
.pipe(babel())
.pipe(uglify()) .pipe(uglify())
.pipe(concat("mp3-min.js")) .pipe(concat("mp3-min.js"))
.pipe(gulp.dest("lib")); .pipe(gulp.dest("lib"));

@ -104,7 +104,7 @@ Respack.prototype.getBlob = function(url, progress) {
resolve(req.response); resolve(req.response);
}; };
req.onerror = function() { req.onerror = function() {
reject(Error("Could not load respack at URL" + url)); reject(Error("Could not fetch respack at URL" + url));
}; };
req.onprogress = event => { req.onprogress = event => {
if (event.lengthComputable) { if (event.lengthComputable) {
@ -117,6 +117,9 @@ Respack.prototype.getBlob = function(url, progress) {
} }
}; };
req.send(); req.send();
}).catch(error => {
// Infinitely more useful than the error Same Origin gives
throw Error("Could not fetch respack at URL" + url);
}); });
} }

Loading…
Cancel
Save