@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface AcpExceptionHandler
The annotated method is called when an exception occurs during handler method invocation. This allows for centralized error handling and conversion of exceptions to appropriate responses.
The method can have the following parameters (all optional):
@SessionId String - the session ID where the error occurredAcpInvocationContext - the invocation contextThe method should return one of:
void - to let the exception propagatenull - to let the exception propagateException handler methods are matched by exception type. More specific exception types take precedence over general ones.
Example usage:
{@codeAcpAgent| 限定符和类型 | 可选元素和说明 |
|---|---|
java.lang.Class<? extends java.lang.Throwable>[] |
value
Exception types handled by this method.
|