A bit more instructive debugging

This commit is contained in:
Mikael Nordfeldth 2017-04-22 10:55:24 +02:00
parent 64b72a3c9b
commit 45dfa9f215
2 changed files with 5 additions and 1 deletions

View File

@ -93,6 +93,8 @@ class Discovery
// Normalize the incoming $id to make sure we have a uri // Normalize the incoming $id to make sure we have a uri
$uri = self::normalize($id); $uri = self::normalize($id);
common_debug(sprintf('Performing discovery for "%s" (normalized "%s")', $id, $uri));
foreach ($this->methods as $class) { foreach ($this->methods as $class) {
try { try {
$xrd = new XML_XRD(); $xrd = new XML_XRD();

View File

@ -1571,12 +1571,14 @@ class Ostatus_profile extends Managed_DataObject
if (is_null($uri)) { if (is_null($uri)) {
// Negative cache entry // Negative cache entry
// TRANS: Exception. // TRANS: Exception.
throw new Exception(_m('Not a valid webfinger address.')); throw new Exception(_m('Not a valid webfinger address (via cache).'));
} }
$oprofile = Ostatus_profile::getKV('uri', $uri); $oprofile = Ostatus_profile::getKV('uri', $uri);
if ($oprofile instanceof Ostatus_profile) { if ($oprofile instanceof Ostatus_profile) {
return $oprofile; return $oprofile;
} }
common_log(LOG_ERR, sprintf(__METHOD__ . ': Webfinger address cache inconsistent with database, did not find Ostatus_profile uri==%s', $uri));
self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), false);
} }
// Try looking it up // Try looking it up