KI-Backend: Antwortretten - Funktion
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-09-04 12:10:42 +02:00
parent 7ef0c95a73
commit fedfceb81d
10 changed files with 435 additions and 14 deletions
+2 -2
View File
@@ -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;
}