errors: report EVERY server/gateway error to GitHub Issues

PHP api/index.php:
- DB connection failure (500) now calls _phpErrorReport()
- Main router catch-all (500) now calls _phpErrorReport()
- undoTransaction DB error (500) now calls _phpErrorReport()

PHP api/cron_smart_shopping.php:
- cron Throwable catch now calls _phpErrorReport() before exit(1)
  (fires even in CRON_MODE since _phpErrorReport() has its own guard)

Scale Gateway GatewayWebSocketServer.kt:
- onError() now calls ErrorReporter.report(ex, ...) in addition to Log.e

Combined with previous kiosk commit, every error path in the entire
EverShelf stack now sends an automatic GitHub Issue.
This commit is contained in:
dadaloop82
2026-05-08 11:34:06 +00:00
parent 96d3514c38
commit 10114dae50
3 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -41,6 +41,9 @@ try {
echo '[' . date('Y-m-d H:i:s') . '] OK — ' . count($decoded['items'] ?? []) . " items cached\n";
} catch (Throwable $e) {
echo '[' . date('Y-m-d H:i:s') . '] ERROR: ' . $e->getMessage() . "\n";
$msg = $e->getMessage();
echo '[' . date('Y-m-d H:i:s') . '] ERROR: ' . $msg . "\n";
// Report to GitHub Issues (uses the same _phpErrorReport from index.php)
_phpErrorReport($msg, $e->getFile(), $e->getLine(), $e->getTraceAsString(), get_class($e));
exit(1);
}