Skip to content

Exception when the error is an array: Argument #1 ($message) must be of type string, array given #10

@sterzuccio

Description

@sterzuccio

Codewithkyrian\ChromaDB\Generated\Exceptions\ChromaException::inferTypeFromMessage(): Argument #1 ($message) must be of type string, array given, called in /app/vendor/codewithkyrian/chromadb-php/src/Generated/ChromaApiClient.php on line 365

Solution:
ChromaApiClient.php row 362

if (isset($error['detail'])) {
                    $message = $error['detail'];
                    if(is_array($message)){
                        $message = $message[0];
                        if(is_array($message)){
                            $message = $message['msg'];
                        }
                    }
                    $error_type = ChromaException::inferTypeFromMessage($message);


                    ChromaException::throwSpecific($message, $error_type, $e->getCode());
                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions