This commit is contained in:
+2
-2
@@ -69,11 +69,11 @@ function ai_backend_authenticate(PDO $pdo): array
|
||||
}
|
||||
|
||||
/** Einheitliche Fehlerantwort als JSON, beendet danach das Skript. */
|
||||
function ai_backend_fail(int $httpStatus, string $message): never
|
||||
function ai_backend_fail(int $httpStatus, string $message, array $details = []): never
|
||||
{
|
||||
http_response_code($httpStatus);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['error' => $message]);
|
||||
echo json_encode(['error' => $message] + $details, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user