diff options
author | smh <smh@FreeBSD.org> | 2016-01-28 12:23:25 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-28 12:23:25 +0000 |
commit | a3f6e8577156792c9839bea3861eedf076da78b2 (patch) | |
tree | b3c0c3f68298e9ad203a0996bbc1d4871c188dbd /sys/boot/common/interp_forth.c | |
parent | 74468e18e88bab67e6156ce77460505c1ebf4df0 (diff) | |
download | FreeBSD-src-a3f6e8577156792c9839bea3861eedf076da78b2.zip FreeBSD-src-a3f6e8577156792c9839bea3861eedf076da78b2.tar.gz |
MFC r293835:
Improve non-interactive forth cmd error reporting
Sponsored by: Multiplay
Diffstat (limited to 'sys/boot/common/interp_forth.c')
-rw-r--r-- | sys/boot/common/interp_forth.c | 12 |
1 files changed, 11 insertions, 1 deletions
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); } |