Skip to content

Commit 20ed937

Browse files
authored
Update RequestTrait.php
1 parent 6928c14 commit 20ed937

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Traits/RequestTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ protected function doStreamRequest($service, $method, $data = [])
169169
protected function handleGrpcStatus($service, $method, $status)
170170
{
171171
if (isset($status->code) && $status->code !== 0) {
172-
try{
173-
$this->ydb->discover();
174-
}catch (\Exception $e){}
175172
$message = 'YDB ' . $service . ' ' . $method . ' (status code GRPC_'.
176173
(isset(self::$grpcExceptions[$status->code])?self::$grpcNames[$status->code]:$status->code)
177174
.' ' . $status->code . '): ' . ($status->details ?? 'no details');
178-
$endpoint = $this->ydb->endpoint();
179175
$this->logger->error($message);
176+
try{
177+
$this->ydb->discover();
178+
}catch (\Exception $e){}
179+
$endpoint = $this->ydb->endpoint();
180180
if ($this->ydb->needDiscovery()){
181181
$endpoint = $this->ydb->cluster()->all()[array_rand($this->ydb->cluster()->all())]->endpoint();
182182
}

0 commit comments

Comments
 (0)