Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
status: number
):
| {
type: 'refresh-token' | 'bad-body';
type: 'refresh-token' | 'bad-body' | 'retry';
value: string;
}
| undefined {
Expand Down Expand Up @@ -229,6 +229,43 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
value: 'Facebook return: No permission to publish the video',
};
}
if (/"error_subcode":459\b/.test(body)) {
return {
type: 'bad-body' as const,
value:
'Facebook is asking you to resolve a security check. Log in at facebook.com, complete it, then try again',
};
}
if (/"error_subcode":492\b/.test(body)) {
return {
type: 'bad-body' as const,
value:
'Your Facebook user no longer has a role on this Page. Ask a Page admin to grant you a role, then reconnect the channel',
};
}
if (body.indexOf('must be granted before impersonating') > -1) {
return {
type: 'refresh-token' as const,
value:
'Facebook Page permissions are missing, please reconnect the channel and allow all permissions',
};
}
if (
/"error_subcode":33\b/.test(body) &&
body.indexOf('does not exist') > -1
) {
return {
type: 'bad-body' as const,
value:
'The Facebook Page or post this was targeting no longer exists, please reconnect the channel and schedule again',
};
}
if (body.indexOf('Sorry, something went wrong') > -1) {
return {
type: 'retry' as const,
value: 'Facebook is temporarily unavailable, please try again later',
};
}
if (body.indexOf('490') > -1) {
return {
type: 'refresh-token' as const,
Expand Down
Loading