diff options
author | Joshua Judson Rosen | 2017-03-26 16:11:44 -0400 |
---|---|---|
committer | Joshua Judson Rosen | 2017-03-28 22:07:50 -0400 |
commit | 712ded7dba135d7beb0c9b4a916605d52e2fa816 (patch) | |
tree | 41d3a464c6d345a92fc5440d353c5a99efd96802 /src | |
parent | robot-move: signal DEATH only _after_ the display has been updated (diff) | |
download | gnurobots-712ded7dba135d7beb0c9b4a916605d52e2fa816.tar.gz |
catch_handler: restore/fix reporting of actual error-messages
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -382,24 +382,30 @@ void gui_main() SCM catch_handler(void *data, SCM tag, SCM throw_args) { -/* - gchar *message = "Couldn't get error message\n"; + gchar *message = NULL; if (scm_ilength (throw_args) > 1 && SCM_NFALSEP (scm_string_p (SCM_CADR (throw_args)))) { - message = SCM_STRING_CHARS (SCM_CADR (throw_args)); + message = scm_to_locale_string (scm_simple_format (SCM_BOOL_F, + SCM_CADR (throw_args), + SCM_CADDR (throw_args))); } else if (SCM_NFALSEP (scm_symbol_p (tag))) { - message = SCM_SYMBOL_CHARS (tag); + message = scm_to_locale_string (scm_symbol_to_string (tag)); } +/* user_interface_update_status (ui, message, -1, -1, -1); */ - - g_printf("Invalid Instruction\n"); + if (message) { + g_printf("Invalid Instruction: %s\n", message); + free (message); + } else { + g_printf("Couldn't get error message\n"); + } return SCM_BOOL_F; } |