From 1a5667fdb56f97fc6bca065669a1b76b14f4da5b Mon Sep 17 00:00:00 2001 From: paladin-t Date: Mon, 22 Feb 2016 16:48:19 +0800 Subject: [PATCH] *polished error code promption. --- shell/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/shell/main.c b/shell/main.c index 27adef7..912af97 100755 --- a/shell/main.c +++ b/shell/main.c @@ -1289,9 +1289,19 @@ static void _on_error(struct mb_interpreter_t* s, mb_error_e e, char* m, char* f if(SE_NO_ERR != e) { if(f) { - _printf("Error:\n Line %d, Col %d in File: %s\n Code %d, Abort Code %d\n Message: %s.\n", row, col, f, e, abort_code - MB_EXTENDED_ABORT, m); + _printf( + "Error:\n Line %d, Col %d in File: %s\n Code %d, Abort Code %d\n Message: %s.\n", + row, col, f, + e, e == SE_EA_EXTENDED_ABORT ? abort_code - MB_EXTENDED_ABORT : abort_code, + m + ); } else { - _printf("Error:\n Line %d, Col %d\n Code %d, Abort Code %d\n Message: %s.\n", row, col, e, abort_code - MB_EXTENDED_ABORT, m); + _printf( + "Error:\n Line %d, Col %d\n Code %d, Abort Code %d\n Message: %s.\n", + row, col, + e, e == SE_EA_EXTENDED_ABORT ? abort_code - MB_EXTENDED_ABORT : abort_code, + m + ); } } }