From d76ac3760b9bc9d9fcbbed03c4f33ec67f79d747 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Wed, 1 Aug 2018 01:58:31 +0100 Subject: [PATCH] Improve debug messages --- ActivityPubPlugin.php | 6 ++++-- utils/explorer.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ActivityPubPlugin.php b/ActivityPubPlugin.php index 094fe56..090d09b 100755 --- a/ActivityPubPlugin.php +++ b/ActivityPubPlugin.php @@ -99,10 +99,12 @@ class ActivityPubPlugin extends Plugin if ($candidate->getUrl() == $url) { // Sanity check return $candidate; } else { - throw new Exception("Notice not found."); + common_debug ('ActivityPubPlugin Notice Grabber: '.$candidate->getUrl(). ' is different of '.$url); + throw new Exception('Notice not found.'); } } catch (Exception $e) { - throw new Exception("Notice not found."); + common_debug ('ActivityPubPlugin Notice Grabber failed to find: '.$url); + throw new Exception('Notice not found.'); } } } diff --git a/utils/explorer.php b/utils/explorer.php index b2be14c..7779497 100755 --- a/utils/explorer.php +++ b/utils/explorer.php @@ -101,7 +101,7 @@ class Activitypub_explorer $this->temp_res = $res; return true; } else { - common_debug('ActivityPub Explorer: Invalid potential remote actor while ensuring URI: '.$url. '. He returned the following: '.json_encode($res, JSON_PRETTY_PRINT)); + common_debug('ActivityPub Explorer: Invalid potential remote actor while ensuring URI: '.$url. '. He returned the following: '.json_encode($res, JSON_UNESCAPED_SLASHES)); } return false; @@ -208,7 +208,7 @@ class Activitypub_explorer $this->discovered_actor_profiles[]= $this->store_profile($res); return true; } else { - common_debug('ActivityPub Explorer: Invalid potential remote actor while grabbing remotely: '.$url. '. He returned the following: '.json_encode($res, JSON_PRETTY_PRINT)); + common_debug('ActivityPub Explorer: Invalid potential remote actor while grabbing remotely: '.$url. '. He returned the following: '.json_encode($res, JSON_UNESCAPED_SLASHES)); } return false;