Class ExceptionEvent

java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
tech.riemann.nif.starter.exception.event.ExceptionEvent
All Implemented Interfaces:
Serializable

public class ExceptionEvent extends org.springframework.context.ApplicationEvent
异常事件类

继承自Spring的ApplicationEvent,用于在系统发生异常时传递异常信息

主要功能: 1. 封装异常对象 2. 通过Spring事件机制发布异常信息 3. 供异常事件监听器处理(如发送告警通知)

使用场景: - GlobalExceptionHandler捕获异常后发布此事件 - WechatWorkRobotExceptionEventListener监听此事件并发送企业微信通知

Author:
Kerbores(kerbores@riemann.tech)
See Also:
  • Constructor Details

    • ExceptionEvent

      public ExceptionEvent(Exception source)
      构造异常事件
      Parameters:
      source - 异常对象
  • Method Details

    • build

      public static @NonNull ExceptionEvent build(Exception source)
      构建异常事件
      Parameters:
      source - 异常对象
      Returns:
      ExceptionEvent实例
    • getException

      public Exception getException()
      获取异常对象
      Returns:
      异常对象