[wp-trac] [WordPress Trac] #64867: Improve AI Client error handling
WordPress Trac
noreply at wordpress.org
Mon Mar 16 14:27:32 UTC 2026
#64867: Improve AI Client error handling
----------------------------+------------------------------------------
Reporter: flixos90 | Owner: flixos90
Type: task (blessed) | Status: assigned
Priority: normal | Milestone: 7.0
Component: AI | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: |
----------------------------+------------------------------------------
The `WP_AI_Client_Prompt_Builder` currently relies on very generic
`WP_Error` objects, without a lot of context. This leads to two problems:
- Much of the granular context that the PHP AI Client exceptions provide
is lost.
- The `WP_Error` objects are not very useful in HTTP context, e.g. in REST
API responses.
We should enhance the logic in the class to leverage the PHP AI Client
exception classes more granularly, and include a `status` in data for the
HTTP status code, so that these `WP_Error` objects are ready to use as
e.g. REST responses.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64867>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list