File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,15 @@ public function __call($name, $arguments)
2828 $ hasContextConnection = Context::has ($ this ->getContextKey ());
2929 $ connection = $ this ->getConnection ($ hasContextConnection );
3030
31+ $ hasError = false ;
3132 $ start = (float ) microtime (true );
3233
3334 try {
3435 /** @var RedisConnection $connection */
3536 $ connection = $ connection ->getConnection ();
3637 $ result = $ connection ->{$ name }(...$ arguments );
3738 } catch (Throwable $ exception ) {
39+ $ hasError = true ;
3840 throw $ exception ;
3941 } finally {
4042 $ time = round ((microtime (true ) - $ start ) * 1000 , 2 );
@@ -51,7 +53,7 @@ public function __call($name, $arguments)
5153 );
5254
5355 if ($ hasContextConnection ) {
54- return ;
56+ return $ hasError ? null : $ result ; // @phpstan-ignore-line
5557 }
5658
5759 // Release connection.
@@ -65,7 +67,7 @@ public function __call($name, $arguments)
6567 $ this ->releaseContextConnection ();
6668 });
6769
68- return ;
70+ return $ hasError ? null : $ result ; // @phpstan-ignore-line
6971 }
7072
7173 // Release the connection after command executed.
You can’t perform that action at this time.
0 commit comments