Automattic\WooCommerce\Internal\Api
QueryCache::error_response
Build a GraphQL-shaped error response array.
Method of the class: QueryCache{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->error_response( $message, $code ): array;
- $message(string) (required)
- The error message.
- $code(string) (required)
- The error code for extensions.
QueryCache::error_response() QueryCache::error response code WC 10.9.4
private function error_response( string $message, string $code ): array {
return array(
'errors' => array(
array(
'message' => $message,
'extensions' => array( 'code' => $code ),
),
),
);
}