[evolution] mail_execute_shell_command: Add logging for easier debugging



commit e149f285acced30a76c1ccd500a8d3b5bb5de8e1
Author: Milan Crha <mcrha redhat com>
Date:   Mon May 11 10:41:58 2020 +0200

    mail_execute_shell_command: Add logging for easier debugging

 src/libemail-engine/mail-ops.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libemail-engine/mail-ops.c b/src/libemail-engine/mail-ops.c
index aefa2ae6dd..dacffed3e1 100644
--- a/src/libemail-engine/mail-ops.c
+++ b/src/libemail-engine/mail-ops.c
@@ -1608,10 +1608,17 @@ mail_execute_shell_command (CamelFilterDriver *driver,
                             gchar **argv,
                             gpointer data)
 {
-       if (argc <= 0)
+       GError *error = NULL;
+
+       if (argc <= 0) {
+               camel_filter_driver_log_info (driver, "Cannot execute shell command, no arguments passed in");
                return;
+       }
+
+       if (!g_spawn_async (NULL, argv, NULL, 0, NULL, data, NULL, &error))
+               camel_filter_driver_log_info (driver, "Failed to execute shell command: %s", error ? 
error->message : "Unknown error");
 
-       g_spawn_async (NULL, argv, NULL, 0, NULL, data, NULL, NULL);
+       g_clear_error (&error);
 }
 
 /* ** Process Folder Changes *********************************************** */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]