feat: better tiktok error

This commit is contained in:
Nevo David 2025-07-28 12:18:27 +07:00
parent 70ac9ce913
commit ee76490a9a
1 changed files with 4 additions and 2 deletions

View File

@ -194,7 +194,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider {
if (body.indexOf('picture_size_check_failed') > -1) {
return {
type: 'bad-body' as const,
value: 'Picture size is invalid',
value: 'Picture / Video size is invalid',
};
}
@ -393,10 +393,12 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider {
}
if (status === 'FAILED') {
const handleError = this.handleErrors(JSON.stringify(post));
throw new BadBody(
'titok-error-upload',
JSON.stringify(post),
Buffer.from(JSON.stringify(post))
Buffer.from(JSON.stringify(post)),
handleError?.value || '',
);
}