Package com.bytedesk.ai.segment
Class SegmentExceptionHandler
java.lang.Object
com.bytedesk.ai.segment.SegmentExceptionHandler
@RestControllerAdvice(basePackages="com.bytedesk.ai.segment")
@ConditionalOnProperty(prefix="bytedesk",
name="debug",
havingValue="true",
matchIfMissing=false)
public class SegmentExceptionHandler
extends Object
分词模块异常处理器
专门处理与分词相关的异常
- Author:
- jackning
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>处理参数异常org.springframework.http.ResponseEntity<?>处理其他未预期的异常org.springframework.http.ResponseEntity<?>处理分词业务异常
-
Constructor Details
-
SegmentExceptionHandler
public SegmentExceptionHandler()
-
-
Method Details
-
handleSegmentException
@ExceptionHandler(SegmentException.class) public org.springframework.http.ResponseEntity<?> handleSegmentException(SegmentException e) 处理分词业务异常- Parameters:
e- 分词异常- Returns:
- 异常响应
-
handleIllegalArgumentException
@ExceptionHandler(java.lang.IllegalArgumentException.class) public org.springframework.http.ResponseEntity<?> handleIllegalArgumentException(IllegalArgumentException e) 处理参数异常- Parameters:
e- 参数异常- Returns:
- 异常响应
-
handleRuntimeException
@ExceptionHandler(java.lang.RuntimeException.class) public org.springframework.http.ResponseEntity<?> handleRuntimeException(RuntimeException e) 处理其他未预期的异常- Parameters:
e- 运行时异常- Returns:
- 异常响应
-