From ee76490a9a9ed39f4a86bf7e25171d010b0338f8 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Mon, 28 Jul 2025 12:18:27 +0700 Subject: [PATCH] feat: better tiktok error --- .../src/integrations/social/tiktok.provider.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts index 0f26a51f..aadeb391 100644 --- a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts @@ -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 || '', ); }