소스 검색

handle 4xx/5xx properly

Gildas 3 년 전
부모
커밋
2fdb083c06
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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);