[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Providers/Http/Util/ -> ErrorMessageExtractor.php (summary)

(no description)

File Size: 53 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ErrorMessageExtractor:: (1 method):
  extractFromResponseData()


Class: ErrorMessageExtractor  - X-Ref

Utility for extracting error messages from API response data.

Centralizes the logic for parsing common API error response formats
to avoid code duplication across exception classes.

extractFromResponseData($data)   X-Ref
Extracts error message from API response data.

Handles common error response formats:
- { "error": { "message": "Error text" } }
- { "error": "Error text" }
- { "message": "Error text" }

return: string|null The extracted error message, or null if none found.
param: mixed $data The response data to extract error message from.



Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref