Explorar o código

handle 4xx/5xx properly

Gildas %!s(int64=3) %!d(string=hai) anos
pai
achega
2fdb083c06
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/single-file/single-file-util.js

+ 3 - 0
src/single-file/single-file-util.js

@@ -235,6 +235,9 @@ function getInstance(utilOptions) {
 			charset = options.charset;
 		}
 		if (options.asBinary) {
+			if (response.status >= 400) {
+				return { data: "data:null;base64,", resourceURL };
+			}
 			try {
 				if (DEBUG) {
 					log("  // ENDED   download url =", resourceURL, "delay =", Date.now() - startTime);