mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-16 03:39:15 +02:00
fix: detect publish_video permission error + show required permissions in Pages UI
- Detect Facebook error subcode 1363042 (missing publish_video permission) and throw a clear actionable message explaining how to fix it - Add permission notice banner in Pages admin showing the 3 required Facebook permissions: pages_manage_posts, pages_read_engagement, publish_video Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f13d3021e
commit
2a93c2aea7
2 files changed
+26
-1
No files matched your search
@@ -592,7 +592,16 @@ export class FacebookService {
|
||||
console.log('📤 Facebook START response:', startRaw);
|
||||
const startData = JSON.parse(startRaw) as any;
|
||||
if (!startRes.ok || startData.error) {
|
||||
throw new Error(`Facebook upload START error: ${startData.error?.message ?? startRaw} (code: ${startData.error?.code}, subcode: ${startData.error?.error_subcode})`);
|
||||
const subcode = startData.error?.error_subcode;
|
||||
if (subcode === 1363042) {
|
||||
throw new Error(
|
||||
`Le token Facebook de la page "${page.pageName}" n'a pas la permission "publish_video". ` +
|
||||
`Régénérez le token dans Graph API Explorer en ajoutant les permissions : ` +
|
||||
`pages_manage_posts, pages_read_engagement, publish_video. ` +
|
||||
`(code: ${startData.error?.code}, subcode: ${subcode})`
|
||||
);
|
||||
}
|
||||
throw new Error(`Facebook upload START error: ${startData.error?.message ?? startRaw} (code: ${startData.error?.code}, subcode: ${subcode})`);
|
||||
}
|
||||
const { upload_session_id, video_id } = startData;
|
||||
let startOffset: number = parseInt(startData.start_offset ?? '0', 10);
|
||||
|
||||
Reference in new issue
Block a user