From e6104533564a7f2960249d335d66bd8a8e6513d8 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Sun, 2 Aug 2026 18:47:51 +0700 Subject: [PATCH] fix(tiktok): preserve initialization error details --- lib/video/video-platforms.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/video/video-platforms.ts b/lib/video/video-platforms.ts index 3c6679a..4e0cf0f 100644 --- a/lib/video/video-platforms.ts +++ b/lib/video/video-platforms.ts @@ -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 }; };