modified: backend/src/services/AqlExecutor.ts
This commit is contained in:
@@ -159,6 +159,18 @@ export class AqlExecutor {
|
||||
throw new Error(`AQL API error (${response.status}): ${errorText}`);
|
||||
}
|
||||
|
||||
// Обрабатываем пустой ответ (204 No Content)
|
||||
if (response.status === 204) {
|
||||
console.log('\n=== AQL Response ===');
|
||||
console.log('Status: 204 (No Content)');
|
||||
console.log('====================\n');
|
||||
return {
|
||||
rows: [],
|
||||
rowCount: 0,
|
||||
executionTime,
|
||||
};
|
||||
}
|
||||
|
||||
// Парсим JSON ответ
|
||||
const responseText = await response.text();
|
||||
console.log('\n=== AQL Response ===');
|
||||
@@ -166,6 +178,15 @@ export class AqlExecutor {
|
||||
console.log('Raw Response:', responseText);
|
||||
console.log('====================\n');
|
||||
|
||||
// Если ответ пустой, возвращаем пустой результат
|
||||
if (!responseText || responseText.trim() === '') {
|
||||
return {
|
||||
rows: [],
|
||||
rowCount: 0,
|
||||
executionTime,
|
||||
};
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(responseText);
|
||||
|
||||
Reference in New Issue
Block a user