Skip to content

Commit

Permalink
Improving tiktok videos listing event log context
Browse files Browse the repository at this point in the history
  • Loading branch information
fokosun committed Aug 23, 2023
1 parent d4ab8c2 commit 54afad8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/Listeners/GetTikTokUserVideos.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle(object $event): void
{
$client = new Client();
$tikTokUser = $event->tikTokUserDto;
$context = [];

$claims = [
'cover_image_url',
'id',
Expand All @@ -29,6 +29,7 @@ public function handle(object $event): void
'embed_html',
'embed_link'
];

$endpoint = 'https://open.tiktokapis.com/v2/video/list/?fields=';

try {
Expand Down Expand Up @@ -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
]
);
}
}
}

0 comments on commit 54afad8

Please sign in to comment.