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