summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile-ssh/error.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libguile-ssh/error.c b/libguile-ssh/error.c
index c0e8936..1ddc0d7 100644
--- a/libguile-ssh/error.c
+++ b/libguile-ssh/error.c
@@ -1,6 +1,6 @@
/* ssh-error.c -- Error reporting to Guile.
*
- * Copyright (C) 2013 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+ * Copyright (C) 2013, 2014, 2015, 2016, 2017 Artyom V. Poptsov <poptsov.artyom@gmail.com>
*
* This file is part of Guile-SSH.
*
@@ -34,8 +34,18 @@ guile_ssh_error (const char *proc, const char *msg, SCM args, SCM rest)
void
guile_ssh_error1 (const char *proc, const char *msg, SCM args)
{
+ char *c_str;
+ scm_dynwind_begin (0);
+
+ c_str = scm_to_locale_string (scm_object_to_string (args, SCM_UNDEFINED));
+ scm_dynwind_free (c_str);
+
+ _ssh_log (SSH_LOG_RARE, proc, "%s: %s", msg, c_str);
+
scm_error (scm_from_locale_symbol (GUILE_SSH_ERROR), proc, msg, args,
SCM_BOOL_F);
+
+ scm_dynwind_end ();
}
/* Report a session error. */