api/bluesky: catch fetch errors (oops)

This commit is contained in:
wukko 2024-09-01 14:39:28 +06:00
parent 6c9601690b
commit b727a56d67
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -7,7 +7,7 @@ const extractVideo = async ({ getPost, filename }) => {
const masterHLS = await fetch(urlMasterHLS) const masterHLS = await fetch(urlMasterHLS)
.then(r => r.text()) .then(r => r.text())
.catch(); .catch(() => {});
if (!masterHLS) return { error: "fetch.fail" }; if (!masterHLS) return { error: "fetch.fail" };
const video = HLS.parse(masterHLS) const video = HLS.parse(masterHLS)
@ -37,7 +37,7 @@ export default async function ({ user, post }) {
} }
}) })
.then(r => r.json()) .then(r => r.json())
.catch(); .catch(() => {});
if (!getPost || getPost?.error) return { error: "fetch.empty" }; if (!getPost || getPost?.error) return { error: "fetch.empty" };