Class ApplicationExceptionMapper
java.lang.Object
io.leandev.appfuse.error.mapper.ApplicationExceptionMapper
- All Implemented Interfaces:
ExceptionMapper<ApplicationException>
public class ApplicationExceptionMapper
extends Object
implements ExceptionMapper<ApplicationException>
AppFuse 自定義異常映射器
處理所有 ApplicationException 子類,轉換為 RFC 7807 ProblemDetail。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ProblemDetail將異常轉換為 ProblemDetail (RFC 7807)boolean檢查此 Mapper 是否支援給定的異常
-
Constructor Details
-
ApplicationExceptionMapper
public ApplicationExceptionMapper()
-
-
Method Details
-
supports
Description copied from interface:ExceptionMapper檢查此 Mapper 是否支援給定的異常- Specified by:
supportsin interfaceExceptionMapper<ApplicationException>- Parameters:
exception- 待檢查的異常- Returns:
- true 如果支援,否則 false
-
map
Description copied from interface:ExceptionMapper將異常轉換為 ProblemDetail (RFC 7807)- Specified by:
mapin interfaceExceptionMapper<ApplicationException>- Parameters:
ex- 待轉換的異常- Returns:
- ProblemDetail 錯誤回應物件
-