From a3f6e8577156792c9839bea3861eedf076da78b2 Mon Sep 17 00:00:00 2001 From: smh Date: Thu, 28 Jan 2016 12:23:25 +0000 Subject: MFC r293835: Improve non-interactive forth cmd error reporting Sponsored by: Multiplay --- sys/boot/common/interp_forth.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys/boot/common/interp_forth.c') diff --git a/sys/boot/common/interp_forth.c b/sys/boot/common/interp_forth.c index 1c37e2b..d5d1a55f 100644 --- a/sys/boot/common/interp_forth.c +++ b/sys/boot/common/interp_forth.c @@ -138,13 +138,23 @@ bf_command(FICL_VM *vm) } else { result=BF_PARSE; } + + switch (result) { + case CMD_CRIT: + printf("%s\n", command_errmsg); + break; + case CMD_FATAL: + panic("%s\n", command_errmsg); + } + free(line); /* * If there was error during nested ficlExec(), we may no longer have * valid environment to return. Throw all exceptions from here. */ - if (result != 0) + if (result != CMD_OK) vmThrow(vm, result); + /* This is going to be thrown!!! */ stackPushINT(vm->pStack,result); } -- cgit v1.1