From bd8db994cecc0809392a2b9738381d6433ea01e1 Mon Sep 17 00:00:00 2001 From: jade Date: Thu, 27 Aug 2026 14:19:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dat/lib/exception/BizException.java | 46 +++++++++++++++++++ .../impl/MemoListRetrieverUseCaseImpl.java | 9 ++++ 2 files changed, 55 insertions(+) create mode 100644 dat-was-lib/src/main/java/io/shinhanlife/dat/lib/exception/BizException.java diff --git a/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/exception/BizException.java b/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/exception/BizException.java new file mode 100644 index 000000000..ee7fe5a66 --- /dev/null +++ b/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/exception/BizException.java @@ -0,0 +1,46 @@ +package io.shinhanlife.dat.lib.exception; + +// import io.shinhanlife.glow.core.exception.abstracts.BusinessException; (이 패키지는 현재 버전에 존재하지 않아 주석 처리함) +import lombok.Getter; +import lombok.Setter; + +/** + * @package io.shinhanlife.dat.lib.exception + * @className BizException + * @description AX HUB 시스템 처리 Exception + * @author 0986406 + * @create 2026.09.01 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.09.01 0986406    최초생성
+ * 
+ * 
+ */ +@Setter +@Getter +public class BizException extends RuntimeException { + + private Object[] replaceStrings; + private String code; + private String msg; + + public BizException(String code) { + super(""); + this.code = code; + this.replaceStrings = new Object[]{""}; + } + + public BizException(String code, Object[] replaceStrings) { + super(""); + this.code = code; + this.replaceStrings = replaceStrings; + } + + public BizException(String code, String msg) { + super(""); + this.code = code; + this.msg = msg; + } +} diff --git a/dat-was-sal/src/main/java/io/shinhanlife/dat/mcc/biz/cmm/usecase/impl/MemoListRetrieverUseCaseImpl.java b/dat-was-sal/src/main/java/io/shinhanlife/dat/mcc/biz/cmm/usecase/impl/MemoListRetrieverUseCaseImpl.java index b48a3f773..c3b4b1cd8 100644 --- a/dat-was-sal/src/main/java/io/shinhanlife/dat/mcc/biz/cmm/usecase/impl/MemoListRetrieverUseCaseImpl.java +++ b/dat-was-sal/src/main/java/io/shinhanlife/dat/mcc/biz/cmm/usecase/impl/MemoListRetrieverUseCaseImpl.java @@ -23,6 +23,15 @@ public class MemoListRetrieverUseCaseImpl implements MemoListRetrieverUseCase { MemoListRetrieverHttpResponse httpResponse = memoClient.call(httpRequest, MemoListRetrieverHttpResponse.class); MemoListRetrieverResponse response = converter.toResponse(httpResponse); + + // Sparrow NULL_RETURN (널 역참조) 방어 로직 + if (response == null) { + response = new MemoListRetrieverResponse(); + response.setResultCode("ERROR"); + response.setResultMessage("HTTP API 응답이 없거나 변환에 실패했습니다."); + return response; + } + response.setResultCode("SUCCESS"); response.setResultMessage("HTTP API call completed."); return response;