catch exceptions in OStatus updates, log, and continue

This commit is contained in:
Evan Prodromou 2010-03-18 07:55:14 -05:00
parent dacd0f3e6d
commit f1af583e3e

View File

@ -56,7 +56,12 @@ try {
$user = new User(); $user = new User();
if ($user->find()) { if ($user->find()) {
while ($user->fetch()) { while ($user->fetch()) {
try {
updateOStatus($user); updateOStatus($user);
} catch (Exception $e) {
common_log(LOG_NOTICE, "Couldn't convert OMB subscriptions ".
"for {$user->nickname} to OStatus: " . $e->getMessage());
}
} }
} }
} else { } else {
@ -118,8 +123,7 @@ function updateOStatus($user)
if (!have_option('q', 'quiet')) { if (!have_option('q', 'quiet')) {
echo "fail.\n"; echo "fail.\n";
} }
continue; common_log(LOG_NOTICE, "Couldn't convert OMB subscription (" . $up->nickname . ", " . $rp->nickname .
common_log(LOG_WARNING, "Couldn't convert OMB subscription (" . $up->nickname . ", " . $rp->nickname .
") to OStatus: " . $e->getMessage()); ") to OStatus: " . $e->getMessage());
continue; continue;
} }