diff --git a/download.js b/download.js
index <HASH>..<HASH> 100644
--- a/download.js
+++ b/download.js
@@ -238,12 +238,14 @@ function getFilesSizes() {
 getFilesSizes();
 
 function getFileContents(filepath) {
-	return new Promise(function(resolve) {
+	return new Promise(function(resolve, reject) {
 		$u.xhr({
 			url: filepath,
 			callback: function(xhr) {
 				if (xhr.status < 400) {
 					resolve(xhr.responseText);
+				} else {
+					reject();
 				}
 			}
 		});
@@ -350,6 +352,7 @@ function generateCode(){
 						
 						promises.push({
 							contentsPromise: cache[path].contentsPromise,
+							path: path,
 							type: type
 						});
 					}
@@ -389,6 +392,11 @@ function buildCode(promises) {
 				i++;
 				f(resolve);
 			});
+			p.contentsPromise['catch'](function() {
+				code[p.type] += '/* Error downloading file '+p.path+' */' + '\n';
+				i++;
+				f(resolve);
+			});
 		} else {
 			resolve(code);
 		}
Reject promise if file does not exist