Class ExceptionMappingRegistry
java.lang.Object
io.leandev.appfuse.error.ExceptionMappingRegistry
異常映射器註冊中心
管理所有 ExceptionMapper 並按優先順序匹配, 將異常轉換為 RFC 7807 ProblemDetail。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ProblemDetail將異常映射為 ProblemDetail (RFC 7807)voidregister(ExceptionMapper<?> mapper) 註冊自定義 Mapper
-
Constructor Details
-
ExceptionMappingRegistry
public ExceptionMappingRegistry()使用預設的 Mapper 集合初始化
-
-
Method Details
-
register
-
map
將異常映射為 ProblemDetail (RFC 7807)- Parameters:
exception- 異常- Returns:
- ProblemDetail
-