[Tarantool-patches] [PATCH 11/12] popen: clarify popen_read_timeout error message

Alexander Turenko alexander.turenko at tarantool.org
Tue Apr 14 14:38:20 MSK 2020


Popen backend errors should be meaningful for a user of the popen Lua
API, because otherwise we'll need to map backend errors into Lua API
errors. This particular failure can't appear when the function is called
from the Lua API, but it is good to keep all error messages in one
style.

Part of #4031
---
 src/lib/core/popen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index 36cd7b07d..640dffc2b 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -360,7 +360,7 @@ popen_write_timeout(struct popen_handle *handle, const void *buf,
  *
  * - IllegalParams: a parameter check fails:
  *   - count: buffer is too big.
- *   - flags: POPEN_FLAG_FD_STD{OUT,ERR} are set or unset both.
+ *   - flags: stdout and stdrr are both choosen or both missed
  *   - handle: handle does not support the requested IO operation.
  * - SocketError: an IO error occurs at read().
  * - TimedOut: @a timeout quota is exceeded.
@@ -379,8 +379,8 @@ popen_read_timeout(struct popen_handle *handle, void *buf,
 	}
 
 	if (!(flags & (POPEN_FLAG_FD_STDOUT | POPEN_FLAG_FD_STDERR))) {
-		diag_set(IllegalParams, "popen: POPEN_FLAG_FD_STD{OUT,ERR} are "
-			 "unset both");
+		diag_set(IllegalParams,
+			 "popen: neither stdout nor stderr is choosen");
 		return -1;
 	}
 
-- 
2.25.0



More information about the Tarantool-patches mailing list