mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-30 10:47:44 +08:00
fixed the problem that grpc client Parser didn't return the correct error info of grpc standard error model
This commit is contained in:
parent
1c3091af7d
commit
c17c49c48b
@ -78,7 +78,9 @@ class Parser
|
||||
return ['No response', self::GRPC_ERROR_NO_RESPONSE, $response];
|
||||
}
|
||||
if ($response->statusCode !== 200) {
|
||||
return ['Http status Error', $response->errCode ?: $response->statusCode, $response];
|
||||
$message = $response->headers['grpc-message'] ?? 'Http status Error';
|
||||
$code = $response->headers['grpc-status'] ?? ($response->errCode ?: $response->statusCode);
|
||||
return [$message, (int)$code, $response];
|
||||
}
|
||||
$grpc_status = (int) ($response->headers['grpc-status'] ?? 0);
|
||||
if ($grpc_status !== 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user