Skip to content

Commit

Permalink
fix: nếu url không lấy được thì không dừng code
Browse files Browse the repository at this point in the history
  • Loading branch information
ooker777 committed Aug 16, 2024
1 parent c4d5021 commit 6053c9f
Show file tree
Hide file tree
Showing 12 changed files with 7,173 additions and 3,870 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export async function lấyHTML(url: Url) {
} else {
urlĐểFetch = url;
}
return await (await fetch(urlĐểFetch)).text();
try {
return await (await fetch(urlĐểFetch)).text();
} catch {
return `Không lấy được HTML cho ${urlĐểFetch}`;
}
}

export function tạoCorsURL(origin: string) {
Expand Down
9,368 changes: 5,840 additions & 3,528 deletions Cấu hình và dữ liệu/Danh sách bài đăng tạo trên local.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6053c9f

Please sign in to comment.