summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Judson Rosen2017-03-26 16:11:44 -0400
committerJoshua Judson Rosen2017-03-28 22:07:50 -0400
commit712ded7dba135d7beb0c9b4a916605d52e2fa816 (patch)
tree41d3a464c6d345a92fc5440d353c5a99efd96802
parentrobot-move: signal DEATH only _after_ the display has been updated (diff)
downloadgnurobots-712ded7dba135d7beb0c9b4a916605d52e2fa816.tar.gz
catch_handler: restore/fix reporting of actual error-messages
-rw-r--r--src/main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 0ce89a8..62a9210 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}