From 2e3f1a546371f4525a9ebb0d148ff04544117b1f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 14 Oct 2021 01:20:53 +0000 Subject: [PATCH] augmented an error message with a function name in lib/run.c --- hawk/lib/run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hawk/lib/run.c b/hawk/lib/run.c index 2afdd92e..6dedcffd 100644 --- a/hawk/lib/run.c +++ b/hawk/lib/run.c @@ -1724,7 +1724,7 @@ hawk_val_t* hawk_rtx_callfun (hawk_rtx_t* rtx, hawk_fun_t* fun, hawk_val_t* args { /* cannot call the function again when exit() is called * in an AWK program or hawk_rtx_halt() is invoked */ - hawk_rtx_seterrnum (rtx, HAWK_NULL, HAWK_EPERM); + hawk_rtx_seterrfmt (rtx, HAWK_NULL, HAWK_EPERM, HAWK_T("now allowed to call '%.*js' after exit"), fun->name.len, fun->name.ptr); return HAWK_NULL; } /*rtx->exit_level = EXIT_NONE;*/ @@ -1751,7 +1751,7 @@ hawk_val_t* hawk_rtx_callfun (hawk_rtx_t* rtx, hawk_fun_t* fun, hawk_val_t* args { /* TODO: is this correct? what if i want to * allow arbitrary numbers of arguments? */ - hawk_rtx_seterrnum (rtx, HAWK_NULL, HAWK_EARGTM); + hawk_rtx_seterrfmt (rtx, HAWK_NULL, HAWK_EARGTM, HAWK_T("too many arguments to '%.*js'"), fun->name.len, fun->name.ptr); return HAWK_NULL; }