Add logging for errors returned from database

Created on 11 August 2025, 8 days ago

Problem/Motivation

1. At the moment it is hard to find out errors in queries from searching milvus.
2. Vector search is done at `\Drupal\ai_vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider::vectorSearch` but there is no logging or exception catching in this method

Steps to reproduce

1. Create a search query with a broken filter
2. Note that there are no results that get returned but no indication what the error with the filters are.

Proposed resolution

1. Add logging in `\Drupal\ai_vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider::vectorSearch` if the expected data structure is not returned `$data['data']`
2. It appears that a `$data['code']` and `$data['message']` is returned from the request.
So:

    if (isset($data['data'])) {
      return $data['data'];
    }
    $this->getLogger('ai_vdb_provider_milvus_provider')->error(sprintf('Error: %s Message: %s', $data['code'], $data['message']));
    return [];

might be all that is needed.

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇦🇺Australia RichardGaunt Melbourne

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

Comments & Activities

Production build 0.71.5 2024