add log and try catch

This commit is contained in:
Tiger Ren 2025-01-01 21:03:11 +08:00
parent 410ba6f6ca
commit da8f36730c
1 changed files with 11 additions and 4 deletions

View File

@ -32,11 +32,18 @@ class TelegramLinkFixerExtension extends Minz_Extension
return; // skip if not a telegram link return; // skip if not a telegram link
} }
try {
// output the $entry
error_log('TelegramLinkFixer: Entry: ' . json_encode($entry));
$description = $entry->description(); $description = $entry->description();
if (empty($description)) { if (empty($description)) {
error_log('TelegramLinkFixer: Skipping - empty description'); error_log('TelegramLinkFixer: Skipping - empty description');
return; return;
} }
} catch (Exception $e) {
error_log('TelegramLinkFixer: Error processing entry: ' . $e->getMessage());
}
// Look specifically for Telegraph links // Look specifically for Telegraph links
error_log('TelegramLinkFixer: Looking for Telegraph link in description: ' . $description); error_log('TelegramLinkFixer: Looking for Telegraph link in description: ' . $description);