From b0b1999258b0dd859fa39c4234620e9918281d1e Mon Sep 17 00:00:00 2001
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Date: Thu, 17 Oct 2019 21:47:07 +0200
Subject: [PATCH] console: fix usage of an undeclared variable

Console client's eval() method in case of an error at
reading from a socket was trying to return a variable
declared in a different view scope. Instead, the
error should be raised to drop the connection.

Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
(cherry picked from commit 89ec1d97a9b7277c29a08b34f11bc14ef2f888df)
---
 src/box/lua/console.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index f70ed830a2..52df674651 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -451,7 +451,7 @@ local text_connection_mt = {
                     self.print_f(rc)
                 end
             end
-            return rc
+            return error(self:set_error())
         end,
         --
         -- Make the connection be in error state, set error
-- 
GitLab