Spaces:
Sleeping
Sleeping
Update app/services/reviewer_service.py
Browse files
app/services/reviewer_service.py
CHANGED
|
@@ -92,12 +92,17 @@ Output a JSON array (exactly 1 object per file):
|
|
| 92 |
|
| 93 |
except Exception as e:
|
| 94 |
logger.error(f"Batch processing error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
for fn in file_names:
|
| 96 |
results.append({
|
| 97 |
"fileName": fn,
|
| 98 |
"vulnerabilities": [],
|
| 99 |
"improvement_suggestions": [],
|
| 100 |
-
"metrics": {"complexity": 0, "maintainability": 0}
|
|
|
|
| 101 |
})
|
| 102 |
|
| 103 |
return results
|
|
|
|
| 92 |
|
| 93 |
except Exception as e:
|
| 94 |
logger.error(f"Batch processing error: {e}")
|
| 95 |
+
error_str = str(e)
|
| 96 |
+
is_config_error = any(x in error_str for x in [
|
| 97 |
+
"QUOTA_EXCEEDED", "RATE_LIMIT_EXCEEDED", "MISSING_API_KEY", "GENERATION_FAILED"
|
| 98 |
+
])
|
| 99 |
for fn in file_names:
|
| 100 |
results.append({
|
| 101 |
"fileName": fn,
|
| 102 |
"vulnerabilities": [],
|
| 103 |
"improvement_suggestions": [],
|
| 104 |
+
"metrics": {"complexity": 0, "maintainability": 0},
|
| 105 |
+
"error": error_str if is_config_error else "analysis_failed"
|
| 106 |
})
|
| 107 |
|
| 108 |
return results
|