类 ErrorEvent

java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.ErrorEvent

@Deprecated(forRemoval=true, since="2.0.0") public final class ErrorEvent extends HookEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
since 2.0.0. Use MiddlewareBase instead.
Event fired when an error occurs during agent execution.

Modifiable: No (notification-only)

Context:

Use Cases:

  • Log errors with context
  • Send error notifications
  • Collect error metrics
  • Implement custom error handling
  • 构造器详细资料

    • ErrorEvent

      public ErrorEvent(Agent agent, Throwable error)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Constructor for ErrorEvent.
      参数:
      agent - The agent instance (must not be null)
      error - The error that occurred (must not be null)
      抛出:
      NullPointerException - if agent or error is null
  • 方法详细资料

    • getError

      public Throwable getError()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Get the error that occurred.
      返回:
      The error