Commit 6c1e4fd5 authored by David Morley's avatar David Morley

sprintf for db debug outputs

parent 96f58043
Pipeline #810 passed with stage
in 3 minutes and 58 seconds
......@@ -29,7 +29,7 @@ try {
FROM pods
');
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
$stop = false;
......@@ -55,7 +55,7 @@ foreach ($pods as $pod) {
R::store($p);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
echo <<<EOF
......@@ -106,7 +106,7 @@ if (!$stop) {
R::store($p);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
if ($_email) {
......
......@@ -53,7 +53,7 @@ foreach ($softwares as $software => $details) {
}
R::store($m);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
}
} elseif ($details['gittype'] === 'gitlab') {
......@@ -77,7 +77,7 @@ foreach ($softwares as $software => $details) {
}
R::store($m);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
}
}
......
......@@ -29,7 +29,7 @@ try {
GROUP BY yymm
");
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
foreach ($monthly_totals as $monthly) {
......@@ -51,7 +51,7 @@ foreach ($monthly_totals as $monthly) {
R::store($p);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
}
......
......@@ -22,7 +22,7 @@ try {
';
$pods = R::getAll($sql);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
//get all existing pod domains
......
......@@ -69,9 +69,9 @@ try {
updateMeta('pods_updating', true);
}
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
} catch (\MaxMind\Db\Reader\InvalidDatabaseException $e) {
debug('Invalid GeoIP database: ' . $e->getMessage());
debug('Invalid GeoIP database: ' . sprintf($e->getMessage()));
}
foreach ($pods as $pod) {
......@@ -95,7 +95,7 @@ foreach ($pods as $pod) {
WHERE domain = ?
', [$domain]);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
debug('Domain', $domain);
......@@ -174,7 +174,7 @@ foreach ($pods as $pod) {
echo $c;
}
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
debug('Version code', $shortversion);
......@@ -188,7 +188,7 @@ foreach ($pods as $pod) {
DESC LIMIT 1
', [$softwarename]);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
$masterversion = ($masterdata['version'] ?? '0.0.0.0');
......@@ -213,7 +213,7 @@ foreach ($pods as $pod) {
LIMIT 1
', [$domain]);
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
$lastdatechecked = ($lastpodupdates['date_checked'] ?? date('Y-m-d H:i:s.u'));
......@@ -288,7 +288,7 @@ foreach ($pods as $pod) {
echo $c;
}
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
--$score;
......@@ -349,7 +349,7 @@ foreach ($pods as $pod) {
$avglatency = $checks['latency'] ?? 0;
$uptime = $checks['online'] ?? 0;
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
debug('Uptime', $uptime);
......@@ -432,7 +432,7 @@ foreach ($pods as $pod) {
echo $newline;
}
} catch (\RedBeanPHP\RedException $e) {
debug('Error in SQL query: ' . $e->getMessage());
debug('Error in SQL query: ' . sprintf($e->getMessage()));
}
debug('Success', $domain);
......
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