fix issues
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user