fix:AI 분석 504 타임아웃 에러 처리 개선

- Controller: analyzeScreenshots()를 try-catch로 감싸 JSON 에러 응답 보장
- Frontend: api() 함수에서 HTML 응답(504/502 등) 감지 → 친절한 한글 에러 메시지 표시

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-15 17:44:35 +09:00
parent ff80d50c9b
commit ff85e1c993
2 changed files with 22 additions and 2 deletions

View File

@@ -84,7 +84,18 @@ public function analyze(Request $request): JsonResponse
}
}
$analysisData = $this->screenAnalysisService->analyzeScreenshots($paths);
try {
$analysisData = $this->screenAnalysisService->analyzeScreenshots($paths);
} catch (\Exception $e) {
\Illuminate\Support\Facades\Log::error('TutorialVideoController: 분석 예외', [
'error' => $e->getMessage(),
]);
return response()->json([
'success' => false,
'message' => 'AI 분석 중 오류가 발생했습니다: ' . $e->getMessage(),
], 500);
}
if (empty($analysisData)) {
return response()->json([