git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 1f013560 authored by mmn's avatar mmn

Fix issue #127 by catching exceptions

update-profile-data.php threw exceptions on http connection issues
parent 60804d19
......@@ -105,7 +105,12 @@ if (have_option('all')) {
$oprofile->find();
echo "Found $oprofile->N profiles:\n\n";
while ($oprofile->fetch()) {
$ok = fixProfile($oprofile->uri) && $ok;
try {
$ok = fixProfile($oprofile->uri) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
}
}
} else if (have_option('suspicious')) {
$oprofile = new Ostatus_profile();
......@@ -114,11 +119,21 @@ if (have_option('all')) {
$oprofile->find();
echo "Found $oprofile->N matching profiles:\n\n";
while ($oprofile->fetch()) {
$ok = fixProfile($oprofile->uri) && $ok;
try {
$ok = fixProfile($oprofile->uri) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
}
}
} else if (!empty($args[0]) && $validate->uri($args[0])) {
$uri = $args[0];
$ok = fixProfile($uri);
try {
$ok = fixProfile($oprofile->uri) && $ok;
} catch (Exception $e) {
$ok = false;
echo "Failed on URI=="._ve($oprofile->uri).": {$e->getMessage()}\n";
}
} else {
print "$helptext";
$ok = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment