From 41f4c46746e1f5442581c1c78302de49bd1faaa5 Mon Sep 17 00:00:00 2001 From: nYeonG4001 <2371324@hansung.ac.kr> Date: Sun, 12 Apr 2026 11:31:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20AI=20=EC=84=9C=EB=B2=84=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EC=8B=A4=ED=8C=A8=20=EC=8B=9C=20500=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95=20(WebClientException=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/devpick/domain/content/client/AiServerClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/devpick/domain/content/client/AiServerClient.java b/src/main/java/com/devpick/domain/content/client/AiServerClient.java index ffb3d4c3..f0c87886 100644 --- a/src/main/java/com/devpick/domain/content/client/AiServerClient.java +++ b/src/main/java/com/devpick/domain/content/client/AiServerClient.java @@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.client.WebClient; -import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.web.reactive.function.client.WebClientException; import java.util.HashMap; import java.util.Map; @@ -53,7 +53,7 @@ public AiSummaryResult fetchSummary(UUID contentId, String text, String thumbnai throw new DevpickException(ErrorCode.AI_SERVER_ERROR); } return result; - } catch (WebClientResponseException e) { + } catch (WebClientException e) { throw new DevpickException(ErrorCode.AI_SERVER_ERROR); } } @@ -82,7 +82,7 @@ public AiQuizResult fetchQuiz(UUID contentId, String text) { throw new DevpickException(ErrorCode.AI_SERVER_ERROR); } return result; - } catch (WebClientResponseException e) { + } catch (WebClientException e) { throw new DevpickException(ErrorCode.AI_SERVER_ERROR); } } From e435e485fde18a330d850b4da2326870a572a384 Mon Sep 17 00:00:00 2001 From: nYeonG4001 <2371324@hansung.ac.kr> Date: Sun, 12 Apr 2026 11:33:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20AI=20=ED=83=80=EC=9E=84=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=8B=9C=20AI=5FTIMEOUT(504)=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EA=B5=AC=EB=B6=84=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/content/client/AiServerClient.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/devpick/domain/content/client/AiServerClient.java b/src/main/java/com/devpick/domain/content/client/AiServerClient.java index f0c87886..f34d68e3 100644 --- a/src/main/java/com/devpick/domain/content/client/AiServerClient.java +++ b/src/main/java/com/devpick/domain/content/client/AiServerClient.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClientException; +import org.springframework.web.reactive.function.client.WebClientRequestException; import java.util.HashMap; import java.util.Map; @@ -54,7 +55,7 @@ public AiSummaryResult fetchSummary(UUID contentId, String text, String thumbnai } return result; } catch (WebClientException e) { - throw new DevpickException(ErrorCode.AI_SERVER_ERROR); + throw toDevpickException(e); } } @@ -83,7 +84,15 @@ public AiQuizResult fetchQuiz(UUID contentId, String text) { } return result; } catch (WebClientException e) { - throw new DevpickException(ErrorCode.AI_SERVER_ERROR); + throw toDevpickException(e); } } + + private DevpickException toDevpickException(WebClientException e) { + if (e instanceof WebClientRequestException requestEx + && requestEx.getCause() instanceof java.util.concurrent.TimeoutException) { + return new DevpickException(ErrorCode.AI_TIMEOUT); + } + return new DevpickException(ErrorCode.AI_SERVER_ERROR); + } }