Catch ClientExceptionInterface in BackendClient

Created on 16 June 2025, 2 months ago

Problem/Motivation

Many functions in src/SearchAPI/BackendClient catch exceptions but not all that can be thrown by what they are calling.

For example, in indexExists, $this->client->indices()->exists() can also throw Psr\Http\Client\ClientExceptionInterface based on OpenSearch\TransportInterface::sendRequest

It looks like many of the other methods could have similar treatment

Steps to reproduce

Try to import config changes to a SAPI OS index when the OS instance is down/unreachable
Get an error Unexpected error during import with operation update for search_api.index.global_search: cURL error 6: Could not resolve host: opensearch

Proposed resolution

Also catch ClientExceptionInterface

πŸ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024