44 lines
3.4 KiB
HTML
44 lines
3.4 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>InfrastructureException.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">project-auth-server</a> > <a href="index.source.html" class="el_package">com.project.auth.infrastructure.support.exception</a> > <span class="el_source">InfrastructureException.java</span></div><h1>InfrastructureException.java</h1><pre class="source lang-java linenums">package com.project.auth.infrastructure.support.exception;
|
|
|
|
/**
|
|
* 인프라 계층(DB, 외부 HTTP 클라이언트, 시크릿 저장소 등) 장애를 표현하는 내부 전용 예외.
|
|
*
|
|
* 등록된 @ExceptionHandler는 ERROR 레벨로 전체 스택트레이스와 함께 {@code detailMessage}를
|
|
* 로깅한다. 따라서 어댑터는 {@code detailMessage}에 민감 정보를 절대 포함시키면 안 된다.
|
|
*
|
|
* detailMessage에 금지: 커넥션 문자열, DB 자격 증명, Vault 토큰, JWT 페이로드 내용,
|
|
* 정제되지 않은 사용자 입력, 외부 호출의 전체 요청/응답 바디.
|
|
*
|
|
* detailMessage에 허용: 식별 불가 형태의 상관 ID, 호스트/서비스 이름, 정제된 상태 코드,
|
|
* 장애 모드를 설명하는 일반 문장. 이 detail은 운영자 트리아지용이며, 클라이언트는 항상
|
|
* COMMON-999만 받는다.
|
|
*/
|
|
public class InfrastructureException extends RuntimeException {
|
|
|
|
private final InfrastructureErrorCode errorCode;
|
|
|
|
public InfrastructureException(InfrastructureErrorCode errorCode) {
|
|
<span class="nc" id="L21"> super(errorCode.message());</span>
|
|
<span class="nc" id="L22"> this.errorCode = errorCode;</span>
|
|
<span class="nc" id="L23"> }</span>
|
|
|
|
public InfrastructureException(InfrastructureErrorCode errorCode, String detailMessage) {
|
|
<span class="fc" id="L26"> super(detailMessage);</span>
|
|
<span class="fc" id="L27"> this.errorCode = errorCode;</span>
|
|
<span class="fc" id="L28"> }</span>
|
|
|
|
public InfrastructureException(InfrastructureErrorCode errorCode, Throwable cause) {
|
|
<span class="fc" id="L31"> super(errorCode.message(), cause);</span>
|
|
<span class="fc" id="L32"> this.errorCode = errorCode;</span>
|
|
<span class="fc" id="L33"> }</span>
|
|
|
|
public InfrastructureException(InfrastructureErrorCode errorCode, String detailMessage, Throwable cause) {
|
|
<span class="nc" id="L36"> super(detailMessage, cause);</span>
|
|
<span class="nc" id="L37"> this.errorCode = errorCode;</span>
|
|
<span class="nc" id="L38"> }</span>
|
|
|
|
public InfrastructureErrorCode getErrorCode() {
|
|
<span class="fc" id="L41"> return errorCode;</span>
|
|
}
|
|
}
|
|
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html> |