fix(tiktok): preserve initialization error details

This commit is contained in:
2026-08-02 18:47:51 +07:00 Unverified
parent 41d87cd9c9
commit e610453356
+6 -2
View File
@@ -296,8 +296,12 @@ async function publishTiktok(upload: typeof videoUploads.$inferSelect) {
}),
},
);
if (!init.ok)
throw new Error(`TikTok upload initialization failed (${init.status}).`);
if (!init.ok) {
const detail = await init.text().catch(() => "");
throw new Error(
`TikTok upload initialization failed (${init.status})${detail ? `: ${detail}` : "."}`,
);
}
const initData = (await init.json()) as {
data?: { publish_id?: string; upload_url?: string };
};