浏览代码

throw error on cancel

Gildas 1 年之前
父节点
当前提交
d7b023f879
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/core/bg/downloads.js

+ 3 - 0
src/core/bg/downloads.js

@@ -237,6 +237,9 @@ async function downloadContent(contents, tab, incognito, message) {
 					replaceBookmarkURL: message.replaceBookmarkURL,
 					includeInfobar: message.includeInfobar
 				});
+				if (!response) {
+					throw new Error("upload_cancelled");
+				}
 			}
 			if (message.bookmarkId && message.replaceBookmarkURL && response && response.url) {
 				await bookmarks.update(message.bookmarkId, { url: response.url });