Annotation Interface WrapBusinessError


@InterceptorBinding @Retention(RUNTIME) @Target({METHOD,TYPE}) public @interface WrapBusinessError
Wraps a matching exception thrown from a "feature" method with an exception that represents a business logic error and is automatically converted to a failed response.

For example, if a Tool method throws an exception it's wrapped with a ToolCallException which is automatically converted to a failed ToolResponse.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Throwable>[]
    The exception is only wrapped automatically if it's assignable from any of the specified classes.
  • Element Details

    • value

      Class<? extends Throwable>[] value
      The exception is only wrapped automatically if it's assignable from any of the specified classes.
      Default:
      {java.lang.Exception.class}