From 54afad83777ef157d8e0f261125019a0ea5b636d Mon Sep 17 00:00:00 2001 From: fokosun Date: Mon, 21 Aug 2023 13:29:51 -0400 Subject: [PATCH] Improving tiktok videos listing event log context --- app/Listeners/GetTikTokUserVideos.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Listeners/GetTikTokUserVideos.php b/app/Listeners/GetTikTokUserVideos.php index f991ae0c..f2006eef 100644 --- a/app/Listeners/GetTikTokUserVideos.php +++ b/app/Listeners/GetTikTokUserVideos.php @@ -16,7 +16,7 @@ public function handle(object $event): void { $client = new Client(); $tikTokUser = $event->tikTokUserDto; - $context = []; + $claims = [ 'cover_image_url', 'id', @@ -29,6 +29,7 @@ public function handle(object $event): void 'embed_html', 'embed_link' ]; + $endpoint = 'https://open.tiktokapis.com/v2/video/list/?fields='; try { @@ -59,9 +60,15 @@ public function handle(object $event): void } else { $db->update($data); } - } catch(\Exception $exception) { - Log::debug('Error listing TikTok videos', ['e' => $exception]); + Log::debug( + 'Error listing TikTok Videos', + [ + 'errorMsg' => $exception->getMessage(), + 'claims' => $claims, + 'endpoint' => $endpoint + ] + ); } } }