ensure*() functions throw exceptions for errors

This commit is contained in:
Evan Prodromou 2011-02-09 03:08:52 -05:00
parent 91485718c4
commit 10500e7f85

View File

@ -1782,12 +1782,14 @@ class Ostatus_profile extends Memcached_DataObject
$oprofile = Ostatus_profile::ensureWebfinger($rest);
break;
default:
common_log(LOG_WARNING,
"Unrecognized URI protocol for profile: $protocol ($uri)");
throw new ServerException("Unrecognized URI protocol for profile: $protocol ($uri)");
break;
}
} else {
throw new ServerException("No URI protocol for profile: ($uri)");
}
}
return $oprofile;
}