asd
This commit is contained in:
@@ -2,9 +2,13 @@
|
||||
try {
|
||||
require_once __DIR__ . '/../../tools/db.php';
|
||||
$pdo = tools_build_pdo();
|
||||
} catch (PDOException $e) {
|
||||
} catch (Throwable $e) {
|
||||
http_response_code(500);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['error' => 'DB connection failed']);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
$payload = ['error' => 'DB connection failed'];
|
||||
if (getenv('APP_DEBUG') === '1') {
|
||||
$payload['detail'] = $e->getMessage();
|
||||
}
|
||||
echo json_encode($payload, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user