]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: report proper context upon error in hlua_cli_io_handler_fct()
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Jun 2024 17:12:37 +0000 (19:12 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 26 Jun 2024 09:06:24 +0000 (11:06 +0200)
As a result of copy pasting, hlua_cli_io_handler_fct() used to report lua
exceptions like E_ETMOUT as "Lua converter" instead of "Lua cli".

Let's fix that.

It could be backported to all stable versions.

[ada: for older versions, HLUA_E_BTMOUT case didn't exist so it has to be
 skipped]

src/hlua.c

index 0a0e2be7518102f565e998f6ac6bef1248a68071..94a6e499839b0bc5d04688eba0f25294cc2d6b22 100644 (file)
@@ -11747,22 +11747,22 @@ static int hlua_cli_io_handler_fct(struct appctx *appctx)
                return 1;
 
        case HLUA_E_ETMOUT:
-               SEND_ERR(NULL, "Lua converter '%s': execution timeout.\n",
+               SEND_ERR(NULL, "Lua cli '%s': execution timeout.\n",
                         fcn->name);
                return 1;
 
        case HLUA_E_BTMOUT:
-               SEND_ERR(NULL, "Lua converter '%s': burst timeout.\n",
+               SEND_ERR(NULL, "Lua cli '%s': burst timeout.\n",
                         fcn->name);
                return 1;
 
        case HLUA_E_NOMEM:
-               SEND_ERR(NULL, "Lua converter '%s': out of memory error.\n",
+               SEND_ERR(NULL, "Lua cli '%s': out of memory error.\n",
                         fcn->name);
                return 1;
 
        case HLUA_E_YIELD: /* unexpected */
-               SEND_ERR(NULL, "Lua converter '%s': yield not allowed.\n",
+               SEND_ERR(NULL, "Lua cli '%s': yield not allowed.\n",
                         fcn->name);
                return 1;