Extend exceptions from AiExceptionInterface

Created on 29 August 2025, about 1 month ago

Problem/Motivation

This is a follow up to this issue ✨ Provide an exception interface all exceptions implement Active . AI Agents will be headed into AI core in 2.0.0 of the module, but we should already prepare so the exceptions is extending the interface in the same manner.

Note that this will only catch any exception that uses AgentExceptions in the tools. If other type of exceptions are thrown, they will not be inheriting this.

Proposed resolution

Extend all exceptions in the module with AgentExceptions.

✨ Feature request
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marcus_johansson
  • @marcus_johansson opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

    LGTM if OK changing -dev requirement to ai -dev

  • πŸ‡©πŸ‡ͺGermany D34dMan Hamburg

    @marcus_johansson,

    Shall I open a ticket to provide guidelines on "when" to extend AiExceptionInterface. As it is quite useful, but out in the wild what is the guideline for module maintainers? Should any module that has something to do with "AI" implement AiExceptionInterface for their Exceptions?

  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    d34man - yes, we should add documentation about it, but I think first someone should research if there is a precedent in Drupal in ECA, Search API or some other foundation module.

    @mglaman, would you know how it works outside of Drupal core exceptions?

    The only clear rules we have at the moment is that the providers should throw exceptions from the AI module since they are really just an extension of it. And for AI Agents, since it will be in AI Core in 2.x.

    Maybe we should add a research and discuss issue and ask on the Monday meeting for feedback?

Production build 0.71.5 2024