fix issues

This commit is contained in:
2025-12-10 03:06:19 +00:00
parent dfb2a3ba6e
commit 3f3e743139
2 changed files with 110 additions and 21 deletions

View File

@@ -1,21 +1,6 @@
<?php
require_once __DIR__ . '/common.php';
/**
* Sends a JSON error response and terminates the script.
* @param int $code HTTP status code.
* @param string $message User-facing error message.
* @param string|null $log_message Optional message for the server log.
*/
function send_error($code, $message, $log_message = null) {
http_response_code($code);
header('Content-Type: application/json; charset=utf-8');
if ($log_message) {
error_log($log_message);
}
echo json_encode(['error' => $message]);
exit;
}
/**
* Handles power outage requests for the new schema.